Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils
- class RobotController {
- def springSecurityService
- def edit() {
- if (Robot.get(params.id).usuario.username == springSecurityService.authentication.name
- || SpringSecurityUtils.ifAnyGranted("ROL_ADMIN,ROL_SUPERADMIN"))
- println "editing allowed"
- else
- println "editing denied"
- }
- }
- grails.plugins.springsecurity.interceptUrlMap = [
- '/index.gsp': ["isAuthenticated()"],
- '/robot/edit/**': ["Robot.get(params.id).usuario.username == springSecurityService.authentication.name
- || hasAnyRole('ROL_ADMIN','ROL_SUPERADMIN')"],
- '/robot/**': ["isAuthenticated()"]
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement