It's such a great pity that we can not use directly it useful methods. 

I don't understand why nobody seem to use the MemoryRealm mode, more exactly only 
write in each source file the full text of  each roles.

For example, I have defined and used an "admin" and "user" roles to separate any parts 
of my web projects. 

Each part of my web project, have in a database table a reference name and a 
corresponding list of role name to make links from roles to parts.

Is every body who are using MemoryRelam, only use from the HttpServletRequest Class 
like this : 
- request.isUserInRole("admin") or request.isUserInRole("user") 

That seems not practical. If we decide to rename in the MemoryRealm, the "admin" role, 
we will have to update in all the java class, servlet, jsp of the project!?

My idea, would be that we can init on the current user session,  a "String[] Roles" 
variable to contain all its corresponding roles if several.

Any suggestions ?


Fran�ois


 -----Original Message-----
From:   Bill Barker [mailto:[EMAIL PROTECTED] 
Sent:   samedi 22 mars 2003 09:45
To:     [EMAIL PROTECTED]
Subject:        Re: MemoryRoles Roles and Users

Well, by default, the GenericPrincipal class shouldn't be accessible from
your Servlet/Filter (ClassLoader magic :).  The best way is a do-it-yourself
parsing of tomcat-users.xml.

"Francois Paris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,

I am trying to list the current user roles, but I don't know very well how I
can do it.

I am using Tomcat/4.1.18.

I have found in the servlet api doc and Catalina api doc, two interesting
methods :

API Servlet :  HttpServletRequest.getUserPrincipal()
API Catalina :  GenericPrincipal.getRoles()

Any ideas ?

Thanks in advance.

Fran�ois.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to