Reputation: 3784
I want to display different menu according to login user . If user is client then display different menu otherwise show different menu.
I have one table User which is used to authenticate user , Client table which hold the userId as foreign key . Then how we determine whether user is client or not?
Another there is any way to add controller for menu?
Upvotes: 0
Views: 1001
Reputation: 11317
One of the best ways would be to use Spring Security plugin. Once setup (which is easy and there is good documentation around) you can control content based on user/roles in a couple ways:
ifAllGraanted('ROLE_ADMIN')
function<sec:ifAllGranted roles="ROLE_ADMIN">
More info here: http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/6%20Helper%20Classes.html
Upvotes: 1