This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread 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 Java 8 in Action this week in the Java 8 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: 15665
    
  15

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.
 
 
subject: managing users , roles , privileges
 
Similar Threads
Previleges to user id in J2EE
Help !!! Designing a privileges based system
Dynamic Creation of Static Text Components
Best Practice For Joined Result Set
Spring security and Userid for authorization, instead of Role and few more questions