Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8541257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:47:28+00:00 2026-06-11T11:47:28+00:00

My problem: I would love to use the Spring Security plugin’s access control/authorization mechanism

  • 0

My problem:

I would love to use the Spring Security plugin’s access control/authorization mechanism with my Grails application without having to use the plugin’s authentication mechanism. The various Grails Spring Security plugin examples (like this one) I’ve found combine these two functions. Is there an easy way to just do access control?

Background:

  • I would like to add roles-based access control to my existing app. I would love to either just annotate my controllers or use the Config.groovy map approach for setting up the access control.
  • My app already has a user domain class.
  • The user domain class already handles encrypting passwords using BCrypt.
  • The app does not have a "role" domain class.
  • I already have controller actions, views and business logic for handling logging in and logging out. I have no interest in replacing this with the plugin’s implementation.

On the right track, but not quite helpful:

I know this is possible to do, as explained in this other question: BUT, that questions and its answers explains how to do it in a Java app using the raw Spring Security framework. I would love for someone to lay out how to do this in a way that is compatible with the latest version (1.2.7.3 as of this writing) of the Grails Spring Security plugin. I don’t want to reinvent wheels that have already been taken care of by the plugin.

In addition, this example explains how to do some of this, but it appears to be outdated because it is based on an older version of the plugin that uses Spring Security 2.x. It also only uses custom authentication for one piece of the app, while it looks like it still uses the Spring Security plugin’s domain classes elsewhere.

How to do it?

Can someone lay out an approach for me?
I assume I need to create my Role domain class.
After that I assume it will involve custom Authentication objects and the like. But how do I hook them into use the plugin’s existing code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:47:29+00:00Added an answer on June 11, 2026 at 11:47 am

    I ended up creating my own access control/authorization mechanism rather than using the Spring Security plugin. I never could figure out how to separate the plugin’s authentication mechanism from the authorization mechanism. Doing the work myself was very easy.

    I did the following:

    • Created a new Role domain class.
    • Added a Set property and hasMany relationship to my User domain class.
    • Created a new AuthorizationFilters filter. This is where I put in my authorization rules. In this filter I can check to see if a user has the role necessary to access the given URL and redirect to a login page, redirect to a “not authorized page” or allow them to pass.

    This doesn’t have the nice syntactic sugar of the plugin and isn’t quite as concise either, but it was very easy to implement and understand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a chat application which I would love to use a SQL
Edit for those who say to use tab control I would love to use
Would love some opinions on this problem I'm trying to workout. I'm trying to
while designing my user control, i encountered the following problem: i would like to
Everyone's raved about how awesome Qt is and I would really love to use
I've come across an interesting problem which I would love to get some input
I am currently using Neo4j over the REST interface and would love to use
I suppose similar problem would have been discussed here, but I couldn't find it.
Any help with this problem would be fantastic. I appreciate all contributions! Let us
Problem: I would like to share code between multiple assemblies. This shared code will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.