Thank you very much for this. Quite helpful!

 
  _____  

Thank You
 
Mick Knutson
 
Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _____  



-----Original Message-----
From: Max Cooper [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:17 AM
To: Struts Users Mailing List
Subject: Re: Fine Grained Access Control in Sturts


Roles are groups are essentially the same thing in the context of
Servlet-spec security.

The method request.isUserInRole("role-name") is all you get.

You can map the more complicated structure to simple roles using some scheme
like this:

groupA.read
groupA.write
groupA.admin
groupB.read
groupB.write
groupB.admin

These are all simple role names. The '.' separator is just an arbitrary
convention and has no meaning beyond the meaning you give it in this
scenario (i.e. the container will do no special processing based on the
presence of the '.').

For the userA you describe, s/he would have these roles:

groupA.read
groupA.write
groupA.admin
groupB.read

So these calls would have these values:

request.isUserInRole("groupA.read") = true
request.isUserInRole("groupA.write") = true
request.isUserInRole("groupA.admin") = true
request.isUserInRole("groupB.read") = true
request.isUserInRole("groupB.write") = false
request.isUserInRole("groupB.admin") = false

You could even write your own Realm to do special processing on the '.'
notation if you want to that would use another table to look up permissions
like "read", "write", "admin" based on the group "groupA" or "groupB". The
container will just ask your Realm implementation if a user has the
"groupA.read" role, but the realm can do whatever processing it needs to do
to get an answer to that question, including consulting a more complex
schema than the basic "user", "role", and "user_role_map" tables. That may
or may not be a useful abstraction to maintain. If you just use the basic
schema, you don't have to do any special processing.

-Max

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 21, 2003 12:10 AM
Subject: RE: Fine Grained Access Control in Sturts


Is there a way to actually use Roles and Groups in Control?
I.E. I have 2 groups, "groupA", and "groupB".
"userA" would have "read", "write" and "admin" role in "goupA", but have
only "read" role in "groupB"

Is this possible?


  _____

Thank You

Mick Knutson

Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _____



-----Original Message-----
From: Max Cooper [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 9:05 AM
To: Struts Users Mailing List
Subject: Re: Fine Grained Access Control in Sturts


A given user can have many roles, so be careful not to break that concept if
you can avoid it. Even if you don't need it now, it is supported by the
standard security stuff and it would be a shame to paint yourself into a
such a corner accidentally. You might need it later.

-Max

----- Original Message -----
From: "Dan Allen" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 20, 2003 9:36 PM
Subject: Re: Fine Grained Access Control in Sturts


> > I always feel bad when I ask a question that is in the existing
> > documentation.
> >
> > For others (unlike David) who do not have the documentation
> > memorized, the "logic:present" tag will take a "role" attribute:
> >
> > Checks whether the currently authenticated user (if any) has been
> > associated with any of the specified security roles. Use a
> > comma-delimited list to check for multiple roles. Example:
> > <logic:present role="role1,role2,role3"> code..... </logic:present>
> >
> > (RT EXPR)
>
> How would this be done with jstl?
>
> <c:if test="${user.role == 'member'}"/>
> ???
>
> not quite as easy, and is 'user' a page scoped variable or is
> something else required.
>
> Dan
>
> --
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Daniel Allen, <[EMAIL PROTECTED]>
> http://www.mojavelinux.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> "I'm old enough to know better, but still too young to care."
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> ---------------------------------------------------------------------
> 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]


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


---------------------------------------------------------------------
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]


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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

Reply via email to