I'm using Grails 2.2.2 and I've already installed spring-security-core-2.0-RC2, by adding the below lines in my BuildConfig.groovy file:
Under the plugins:
compile ':spring-security-core:2.0-RC2'
Under Repositories:
mavenRepo 'http://repo.spring.io/milestone'
The plugin was installed successfully and I've created the security Domains and Controllers using s2-quickstart script.
Now, I've updated one of my controllers with the below code:
import grails.plugins.springsecurity.Secured
@Secured(['ROLE_ADMIN'])
However when I try to run the application I get the below error:
| Error Compilation error: startup failed: C:\workspace\SW Development\Production\MyGrailsApp\safami\grails-app\controllers\safami\InfoPageAdminController.groovy: 4: unable to resolve class grails.plugins.springsecurity.Secured @ line 4, column 1. import grails.plugins.springsecurity.Secured
I'm new to Grails and I need your detailed solution.
The annotation was moved to a different package - change
import grails.plugins.springsecurity.Secured
to
import grails.plugin.springsecurity.annotation.Secured
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With