Home > Uncategorized > Adding spring security to your grails app

Adding spring security to your grails app

December 12th, 2011 Leave a comment Go to 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 Tags:
  1. No comments yet.
  1. No trackbacks yet.

Time limit is exhausted. Please reload CAPTCHA.