Last updated by gavingc
2 years ago
Experimental support for securing your Service methods with Annotations, e.g.NOTE:
Annotations are NOT secure unless Config.groovy:
See: http://jira.grails.org/browse/GPACEGI-41
grails.mime.file.extensions = falseimport org.springframework.security.annotation.Secured;class SomeService { static transactional = true static scope = "request" @Secured(["ROLE_SUPERVISOR"]) def getSome(){ println "getSome()" return "this method is for ROLE_SUPERVISOR Only" } @Secured(["ROLE_USER"]) def doSome(){ println "doSome() method for ROLE_USER" return "this method is for ROLE_USER Only" } }