• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Patience is a virtue.
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone?
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
     
    These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic