I just upgraded my grails application from 2.2.1 to 2.3.4 with mostly success and upgraded spring security plugin from 1.2.7.3 to 2.0-RC2. However, I'm getting an error regarding the spring security plugin (spring-security-core:2.0-RC2).
Annotation @grails.plugin.springsecurity.annotation.Secured is not allowed on element FIELD
I thought it might have something to do with the new restriction of only being able to annotate methods instead of actions but I am annotating the method not an action... so...
Here's annotated controller (although the message appears for all annotations):
@Secured(['IS_AUTHENTICATED_FULLY', 'ROLE_SHOW'])
def history = {
def instanceList = super.history(Perm.get(params.id))
[instanceList: impInstanceList]
}
I believe you need to change that to
@Secured(['IS_AUTHENTICATED_FULLY', 'ROLE_SHOW'])
def history() {
def instanceList = super.history(Perm.get(params.id))
[instanceList: impInstanceList]
}
I.e. change it to a method from a closure definition
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