views:

248

answers:

1

If I create tabs using one of the Grails GUI options (which one should I use), is it possible to turn tabs on and off, based on the current user? For example only users with a role of admin should see the Manage Users tab. And even anonymous users should see the Main Content tab.

Ideally, I'd like to use Spring Security ACL.

A: 

Yes, it's possible and pretty easy with the Acegi (Spring Security Plugin), see this section of the docs. You'll need to define some roles, and then describe how those roles apply to different URLS. Example (from link above):

/admin/=ROLE_USER /book/test/=IS_AUTHENTICATED_FULLY /book/**=ROLE_SUPERVISOR

There is also explanation about exactly how to do this in Grails In Action book.

Jean Barmash
Thanks for your reply. This addresses securing URLs. However, requirement is secure specific tabs on the same page.The prototype of my app (done using ZK which I'm having doubts about) is at http://flashlit.serveall.net/flashlit.
Brad Rhoads
if by the same page you mean that the HTML used to render all tabs are sent in the same http request, then you are out of luck - the design of your app's security layer needs to be changed so that the secure content dont get sent. It is much easier and more modular to segregate by url (and then use ajax to load the tab's content).
Chii