This might come through twice - if so, sorry.

On 03/25/2004 11:28 AM Tom Bednarz wrote:

1) How are Roles defined? Where are they stored? I don't want these
things stored in a XML file. Is there a way to store these things
in a database? Is there any documentation about a datamodel
(Fields, datatypes etc)


Hi Tom,
for this you should check the different Realm implementations available,
see the docs on jakarta's tomcat website. There is a JDBC realm  that
sounds right for your purposes.



2) How are roles assigned to users or groups of users? Where are
these assignments stored? Basically roles should be assigned to
groups. Users will then join or leave groups with specific
privileges.


This is done at login by tomcat, but such mechanisms should be available
on all containers. The user name is stored in the session (although not
available to you by session.getAttribute(), only
request.getUserPrincipal() or getRemoteUser() ) plus the roles are
stored as an array of strings, e.g. user, admin, super, available again
via the request.isUserInRole() boolean method. Should be
container-independent.


3) What do I need to do in Struts to configure all this? I read
that since 1.1 I can define a role property in ActionMappings. How
and against what is that definition verified? Are there any
standard/basic mechanisms that can be extended ?


Struts checks against request.isUserInRole(). I don't think it's
standard or basic to extend this. However it's open-source, so you could
do whatever you wanted. The same applies to tomcat.



4) Is there any menu system available, that supports roles and can
be integrated in a Struts based application?


Have you checked out struts-menu? I think it's on source-forge, if not
check for the link on the struts website.



5) Are there any special considerations when moving from Struts 1.0
to 1.1? With other words, is the code backward compatible or will
my working code for 1.0 not work anymore on 1.1?


There's an upgrade doc on the struts website. It is /mostly/ backwards
compatible. I've heard of many people just dropping in the new struts
jar to their project and having no problems.

Adam

--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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



Reply via email to