0
votes

I'm following this tutorial https://grails-plugins.github.io/grails-spring-security-core/guide/tutorials.html, but @Secured annotation cannot be resolved, though I applied Spring Security plugin and compiled.

import grails.plugin.springsecurity.annotation.Secured
class SecureController {
   @Secured('ROLE_ADMIN')
   def index() {
      render 'Secure access only'
   }
}
1
whats your build file looks like ? (either build.gradle for 3.x or buildconfig.groovy) - Frederic Henri
build.gradle dependencies { … compile 'org.grails.plugins:spring-security-core:3.0.0.M1' compile "org.springframework.security:spring-security-core:4.0.1.RELEASE" compile "org.springframework.security:spring-security-web:4.0.2.RELEASE" … } - Margarita Spasskaya

1 Answers

0
votes

You applied the spring-security libraries, but not the spring-security-core plugin.

The dependency for the plugin look like:

plugins {
  compile ':spring-security-core:2.0-RC5'
}