• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

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

 
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?
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone?
 
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?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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 ]
     
    reply
      Bookmark Topic Watch Topic
    • New Topic