Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Customizing Menu Bar base on Security Role

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In tiles taglib, I can see the role= attribute for customizing view base on user's role. I am wondering if this attribute is also available in other struts taglib like <html:link>. I want to have a list of links to be optionally displayed only when the user is logged in as certain role.

What else could I use to achieve this result. Would there be any ready made taglib supporting this?
 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if you can use the roles in the tags. That would be very nice if it could.

But other way to achieve what you want is using some flag attributes in the code (if a certain user logs on set this flag to a value and compare in your view on that flag), or using <logic:equals> on the current user attribute that contains users role (if the user is put in the session).
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It wouldn't be very difficult to implement this by creating your own taglib or extending Struts tags. It may seem intimidating now but once you get started you'll be fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic