
skeleton.grails-app.controllers.rest.SecuredController.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-security-rest-testapp-profile Show documentation
Show all versions of spring-security-rest-testapp-profile Show documentation
Grails plugin to implement token-based, RESTful authentication using Spring Security
The newest version!
package rest
import grails.plugin.springsecurity.annotation.Secured
class SecuredController {
def springSecurityService
@Secured(['ROLE_USER'])
def index() {
render springSecurityService.principal.username
}
@Secured(['ROLE_SUPER_ADMIN'])
def superAdmin() {
render springSecurityService.principal.username
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy