This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "managing users , roles , privileges" Watch "managing users , roles , privileges" New topic
Author

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: 16019
    
  20

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

where


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: managing users , roles , privileges