I have a project in Grails 2.4.4 using Spring Security Rest Plugin 1.5.4 for Grails along with Spring Security Core 2.0.0 and I'm getting this warning:
Warning |
The [getAssociatedToEntities] action in [security.UserController] accepts a parameter of type [java.util.List]. Interface types and abstract class types are not supported as command objects. This parameter will be ignored.
@Secured("hasAnyRole('READ__USER', 'READ__PROFILE')")
^
This is the code...
BuildConfig
//...
compile "org.grails.plugins:spring-security-core:2.0.0"
compile "org.grails.plugins:spring-security-rest:1.5.4"
//...
UserController (the code where the warning comes from!)
@Secured("hasAnyRole('READ__USER', 'READ__PROFILE')")
def getAssociatedToEntities(List<Long> e, SearchCommand cmd){
//code omitted
}
Thanks in advance!
java.util.List
is an Interface which cannot be used as a Command Object, try this instead:
Create a Command Object with the list inside
import grails.validation.Validateable
@Validateable
class SearchListCommand extends SearchCommand {
List values
}
and replace the declaration of the List with the Command Object in the getAssociatedToEntities
action
def getAssociatedToEntities(SearchListCommand listCommand) {
//code omitted...
}