Hi ,

with isUserInRole you can check whether the the current remote User has the
role you specified.

There is also an method   

//check authentication assuming that user needs the role "editor" for the
action
if (!request.isUserInRole("editor")) {
  throw new Exception("user not authenticated for this action");
}

I have defined the roles in tomcat-users.xml as I am using this basic
scheme.

Martin


> -----Ursprüngliche Nachricht-----
> Von: news [mailto:[EMAIL PROTECTED] Im Auftrag von Grzegorz Stasica
> Gesendet: Dienstag, 28. Juni 2005 18:35
> An: user@struts.apache.org
> Betreff: isUserInRole - how it works
> 
> 
> hi,
> 
> Actinally my question is how to access container from struts 
> action but 
> if I know how isUserInRole is working I'll be able to solve my main 
> problem which is:
> Is it possible to access container from action. I'm using 
> securityfilter 
> which extends BaseRealm. In this way I can put additional 
> parameter to 
> user being authorized but the problem is that I'm not able to 
> access it 
> from the action. There is only function: request.isUserInRole() but 
> unfortunatelly I do not know how it works
> 
> 
> ---------------------------------------------------------------------
> 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