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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:42:06+00:00 2026-05-29T09:42:06+00:00

I have some controllers in my grails application:- LoginController LogoutController SearchableController cirnele.SearchAllController com.ten.cirnelle.domain.CustomerController com.ten.cirnelle.domain.ProjectController

  • 0

I have some controllers in my grails application:-

LoginController
LogoutController
SearchableController
cirnele.SearchAllController
com.ten.cirnelle.domain.CustomerController
com.ten.cirnelle.domain.ProjectController
com.ten.cirnelle.domain.PurchaseOrderController
com.ten.cirnelle.domain.QuotationController
com.ten.cirnelle.domain.ResourceController

In Config.groovy, I have provided one of my configration:-

cirnelleControllerExclusions =['Login','Search','Searchable','Resource']

and from main.gsp, I am using:-

<g:each var="c" in="${grailsApplication.controllerClasses.sort { it.fullName } }">

    <g:if test="${grailsApplication.config.cirnelleControllerExclusions.contains(c.naturalName.split()[0]) == false}">

        <li class="controller"><g:link controller="${c.logicalPropertyName}">${c.naturalName.split()[0]}</g:link></li>
    </g:if>
</g:each>

this code is used to provide a menu like structure at the top of every view page and it is excluding 4 cotrollers, that i specified in Config.groovy to be display as a link in view pages.
but i have many users with different roles like

ROLE_PM
ROLE_SALES/BDM
ROLE_TEAMMEMBER
ROLE_ADMIN

and my requirement is that if an user with admin role logins, then he can view all the controllers as a link(except the 4) but if a user with PM role logins, then he cannot view CustomerController link and QuotationCotroller link.
so how can i customized my main.gsp to show menu links based on the role of user.
thnks

  • 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-29T09:42:06+00:00Added an answer on May 29, 2026 at 9:42 am

    Try to use spring security plugin. There are tags for doing exactly what you want.

    <sec:ifNotLoggedIn>
      <g:link controller="login" action="auth">Login</g:link>
    </sec:ifNotLoggedIn>
    <sec:ifAllGranted roles="ROLE_USER">
      <g:link class="create" controller="post" action="timeline">My Timeline</g:link>
    </sec:ifAllGranted>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 3yr old application that has some controllers with some very unrestful
I have many controllers that will have some similar behavior, e.g. the user should
I'm developing a Grails web application (mainly as a learning exercise). I have previously
I have a Grails app with some pages only accessible over https and some
I have an application that uses the grails multi-tenant-core plug-in to host multiple versions
I have a Java\Spring\Hibernate application - complete with domain classes which are basically Hibernate
i have a grails application and i'm following the tutorial here: http://www.grails.org/Services i have
I have installed Quartz plugin in my Grails 2.1 application. Every 5 minutes one
I have a question about a grails application. I have a controller that does
I'm using Grails 1.3.7. I have some code that uses the built-in base64Encode function

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.