Adding spring security to your grails app
December 12th, 2011
No comments
Check out this article over here:
Spring security with the spring-security plugin for grails
Issue the following commands to add spring security to your app.
grails install-plugin spring-security-core grails s2-quickstart your.package.name SecUser SecRole
Add the following two lines to UrlMappings.groovy:
"/login/$action?"(controller: "login") "/logout/$action?"(controller: "logout")
I personally prefer to use annotations.
@Secured(['ROLE_USER'])
class PostController {
@Secured(['ROLE_ADMIN'])
def deletePost = { //...
}
}
Categories: Uncategorized