I am currently developing a web application in Grails, and I am looking for a way to hide the menu based on the current user registered in the solution.
To give you some background, this is what I set
- Web application with user model model and roles displayed
- A login feature that restricts certain controllers based on user access.
- I have menus that appear on every page.
I know how to restrict the controller to only allow users who have access to view it, but I want to restrict the menu as shown below, if the correct user is not registered, how can I do this? Does it have anything to do with rendering this element from the controller?
<div class="nav"> <ul class"nav"> <li> <g:link class="Tester" controller="Testing" action="test"> <g:message code="Tester" args"[entityName]" /> </g:link> </li> <li> <g:link class="Tester2" controller="Testing" action="test2"> <g:message code="Tester2" args"[entityName]" /> </g:link> </li> </ul> </div>
source share