File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes managing users , roles , privileges Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "managing users , roles , privileges" Watch "managing users , roles , privileges" New topic

managing users , roles , privileges

Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Hi All,

I have worked using strut for sometime and i was using the tag

to show and hide the links/buttons and privileges depending upon the role of the user and its privileges

for example some users have the privileges to see the 'list user management' icon link and some not.
and in the level of the page also , that is not all the users who have privileges to view the users list, can edit or delete.

is there any component similar to logic:equal in strut , or how i can i manages the users , their roles and their privileges

by the way the roles and privileges are dynamic data stored in db .

Thanking you in Advance
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Any reply
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

You can hide elements by using the redered attribute:

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Thanks a lot Wouter Oet ....... it is exactly what I was looking for .
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Although the Apache Tomahawk tag library has tags which have direct role support, most JSF does not, unfortunately. So the "rendered" attribute is the usual solution.

In general, however, it's better to keep complex expressions off the View and in the backing bean. So instead of :

You might want something simpler and more targeted, such as


An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: managing users , roles , privileges
It's not a secret anymore!