Last updated by gavingc 3 years ago
Experimental support for securing your Service methods with Annotations, e.g.

NOTE: Annotations are NOT secure unless Config.groovy:

grails.mime.file.extensions = false
See: http://jira.grails.org/browse/GPACEGI-41

import 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" } }