tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Walter, Oliver (BR/ICI3)" <>
Subject AW: datasource-realm troubles
Date Tue, 30 Jan 2007 18:07:33 GMT
Thanks Chuck,

i followed your suggestion and it works fine. Maybe you can help me with another problem i

Right now i can use RealmDataSource to authenticate the user. But want/have to go bit deeper
authorization, e.g. build up a dynamic navigation based on the users roles. I investigated
a bit
in the catalina API, but i cannot find any interface to access a list of the roles the user

HttpServletRequest.getUserPrincipal() is of type and DataSourceRealm.getRoles

is protected. What i try to access is a object of type GenericPrincipal (because of the getRoles()
method), but don`t know where from.

What i can think of is getting a list off all in Context defined roles StandardContext.findSecurityRoles(),

and check with a loop if the DataSourceRealm.hasRole(Principal, role), but i still hope to
find a more
elegant solution. 

Maybe you have any idea.

Regards Oliver

> -----Urspr√ľngliche Nachricht-----
> Von: Caldarale, Charles R [] 
> Gesendet: Dienstag, 30. Januar 2007 17:22
> An: Tomcat Users List
> Betreff: RE: datasource-realm troubles
> > From: Walter, Oliver (BR/ICI3) 
> [] 
> > Subject: AW: datasource-realm troubles
> Now that you've got the main problem sorted, some additional info for
> you:
> > The file is named "context.xml" and it is stored in the
> > war`s META-INF directory. 
> >
> > <Context path="/jmangos" docBase="jmangos" debug="5"
> > reloadable="true" crossContext="false">
> The path and docBase attributes must not be used when the <Context>
> element is in META-INF/context.xml (path is valid only within
> server.xml, and docBase only within conf/Catalina/[host]/[appName].xml
> or server.xml).  Although they should be ignored in this situation,
> their presence is confusing.
>  - Chuck
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete 
> the e-mail
> and its attachments from all computers.
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message