Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How get all User's roles in JSP/Servlet?

 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to check that a user is in a role via: isUserInRole(), but how do I list all of the user's roles?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the problem.
Tell the details
[ May 17, 2005: Message edited by: Adeel Ansari ]
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adeel Ansari:
Where is the problem.
Tell the details

[ May 17, 2005: Message edited by: Adeel Ansari ]



That is NOT a good description of my post. There's nothing more to be descriptive about.

there is a method: isUserInRole() which checks if a user has the role you pass that method. I want a method that retrieves all the roles the user has/is a ameber of. I cannot find such a method. Is there one?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there is.
I skimmed both the J2EE API (link in my signature)
and SRV12 in the Servlet Spec (also has a link in my signature).

The only 3 methods that seem to be available to the Servlet programmer are:
  • getRemoteUser
  • isUserInRole
  • getUserPrincipal


  • There also are not any methods for adding users to roles, creating roles, removing etc...
    It seems that the intent of the spec was to keep the management of these deployment issues outside of the actual application.
    [ May 18, 2005: Message edited by: Ben Souther ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic