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 590287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:30:45+00:00 2026-05-13T15:30:45+00:00

Might be just me, but I have a hard time understanding how to secure

  • 0

Might be just me, but I have a hard time understanding how to secure just some of the pages in a Grails application with the Shiro Plugin.

I use this in my security filter:

class SecurityFilters {
  def filters = {
    all(uri: "/**") {
      before = {
        // Ignore direct views (e.g. the default main index page).
        if (!controllerName) return true

        // Access control by convention.
        accessControl ( auth:false)
      }
    }
  }
}

and I have created a user in my bootstrap:

    def adminRole = new Role(name: "Administrator")
    adminRole.addToPermissions("secured1")
    adminRole.addToPermissions("secured2:create,save,edit,update")
    adminRole.save()

    def user = new User(username: "admin", passwordHash: new Sha512Hash("***").toHex())
    user.addToRoles Role.findByName('Administrator')
    user.save()

and it works. Problem is, that it also secures all controllers/actions.

I was hoping, that it would be possible to NOT specify the actions I want to protect in my SecurityFilter, but only in the permissions.. But is this possible?

  • 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-05-13T15:30:45+00:00Added an answer on May 13, 2026 at 3:30 pm

    The static property ‘filter’ allows you to define multiple filtering patterns. You can use the ‘uri’ parameter or the ‘controller’ parameter. If you use ‘controller’ you can also add an ‘action’ parameter. Each of these parameters takes a regular expression so you can do stuff like:

    admin(uri:"/admin/**")
    ...
    browseStore(controller:"store", action:"(show|list)")
    ...
    shopStore(controller:"store", action:"*")
    ...
    

    Check out http://www.grails.org/Filters for more info.

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

Sidebar

Related Questions

I might just be using the wrong keywords on Google, but what I have
This might not have a major usecase in projects, but I was just trying
Ok, this might just be a dumb question, but I was wondering if Bluetooth
This might sound like a stupid question but just trying to learn something here.
This might turn out to be a stupid typo but just incase there is
I had a crazy (but so crazy that it just might work) idea where
There might be a really simple solution to this question, but i just don't
This might be a simple question but I'm just picking this up so please
I feel like this might be really simple but I'm just not getting it
I'm just a beginner at c++ so I might be doing something wrong but

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.