You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by su...@tcs.com on 2004/02/18 16:19:02 UTC

Role based access?

Hi Guys,

Struts-config.xml
                <action attribute="Form"   roles="userRole">

How do i use this 'roles' attribute to implement role-based access.

Thanks and Regards

Subramaniam Olaganthan
Tata Consultancy Services
Mailto: subramaniam.o@tcs.com
Website: http://www.tcs.com

Re: Role based access?

Posted by Nadeem Bitar <na...@izucode.com>.
processRoles method is in RequestProcessor.
You would do something like this:

boolean processRoles(HttpServletRequest request, HttpServletResponse
response, ActionMapping mapping) throws Exception{
 String[] roles = mapping.getRoleNames();
 if(roles == null || roles.length == 0)
	return true
  for(int i=0; i<roles.length; i++){
	//check if the current user is in any of the specified roles
        //using your custom security scheme usually something like that
        if(request.isUserInRole(roles[i]))
		return true;
  }
  return false;

}
On Thu, 2004-02-19 at 01:26 +0530, subramaniam.o@tcs.com wrote:
> Hi, 
> Thanks for the info Nadeem.but processRoles method is in which Class. 
> could you give me some samples. 
> Thanks in advance 
> 
> 
> Subramaniam Olaganthan
> Tata Consultancy Services
> Mailto: subramaniam.o@tcs.com
> Website: http://www.tcs.com 
> 
> 
> Nadeem Bitar <na...@izucode.com> 
> 
> 02/19/2004 12:59 AM 
>          Please respond to
>     "Struts Users Mailing List"
>  <st...@jakarta.apache.org>
> 
> 
>                To
> Struts Users
> Mailing List
> <struts-
> user@jakarta.
> apache.org> 
>                cc
>           Subject
> Re: Role based
> access?
> 
> 
> 
> You have to use JAAS. If you are not using JAAS and still want to use
> the roles attribute in your action mapping you have to override the
> processRoles method .
> 
> 
> On Wed, 2004-02-18 at 20:49 +0530, subramaniam.o@tcs.com wrote:
> > Hi Guys, 
> > 
> > Struts-config.xml 
> >                 <action attribute="Form"   roles="userRole"> 
> > 
> > How do i use this 'roles' attribute to implement role-based access. 
> > 
> > Thanks and Regards 
> > 
> > Subramaniam Olaganthan
> > Tata Consultancy Services
> > Mailto: subramaniam.o@tcs.com
> > Website: http://www.tcs.com
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ForwardSourceID:NT00003A5E     
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Role based access?

Posted by su...@tcs.com.
Hi,
Thanks for the info Nadeem.but processRoles method is in which Class.
could you give me some samples.
Thanks in advance


Subramaniam Olaganthan
Tata Consultancy Services
Mailto: subramaniam.o@tcs.com
Website: http://www.tcs.com



Nadeem Bitar <na...@izucode.com> 
02/19/2004 12:59 AM

Please respond to
"Struts Users Mailing List" <st...@jakarta.apache.org>


To
Struts Users Mailing List <st...@jakarta.apache.org>
cc

Subject
Re: Role based access?






You have to use JAAS. If you are not using JAAS and still want to use
the roles attribute in your action mapping you have to override the
processRoles method .


On Wed, 2004-02-18 at 20:49 +0530, subramaniam.o@tcs.com wrote:
> Hi Guys, 
> 
> Struts-config.xml 
>                 <action attribute="Form"   roles="userRole"> 
> 
> How do i use this 'roles' attribute to implement role-based access. 
> 
> Thanks and Regards 
> 
> Subramaniam Olaganthan
> Tata Consultancy Services
> Mailto: subramaniam.o@tcs.com
> Website: http://www.tcs.com
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


ForwardSourceID:NT00003A5E 

Re: Role based access?

Posted by Nadeem Bitar <na...@izucode.com>.
You have to use JAAS. If you are not using JAAS and still want to use
the roles attribute in your action mapping you have to override the
processRoles method .


On Wed, 2004-02-18 at 20:49 +0530, subramaniam.o@tcs.com wrote:
> Hi Guys, 
> 
> Struts-config.xml 
>                 <action attribute="Form"   roles="userRole"> 
> 
> How do i use this 'roles' attribute to implement role-based access. 
> 
> Thanks and Regards 
> 
> Subramaniam Olaganthan
> Tata Consultancy Services
> Mailto: subramaniam.o@tcs.com
> Website: http://www.tcs.com
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Session management

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
For the sake of a clean design, restrict your transaction management to 
your model layer (in MVC). That means, like Navjot says, keep it clear 
of your struts action classes.

On 02/24/2004 10:19 AM Navjot Singh wrote:
> struts has nothing to do with managing sessions. we should better 
> talk about servlet containers that handles sessions.
> 
> btw, 100 sessions are nothing to worry about :-)
> 
> leave the txn mgmt to db layer. use any of the persistence frameworks
> that can handles this for you.
> 
> 
>>-----Original Message-----
>>From: Parag [mailto:mparag@mahindrabt.com]
>>Sent: Tuesday, February 24, 2004 2:44 PM
>>To: Struts Users Mailing List
>>Subject: Session management
>>
>>
>>Experts,
>>
>>We are planning to build an application, for which expected 
>>concurrent users
>>are ~100. Total usrs being 2000.
>>
>>Does Struts provide any facilities to manage Sessions on such scale?
>>
>>Some of the functionality is very data intensive, and would need 
>>transaction
>>management. What is the prefered way of doing so? Are there any facilities
>>in Struts
>>
>>All your comments are highly appreciated.
>>
>>Regards
>>Parag
>>
>>*********************************************************
>>Disclaimer
>>
>>This message (including any attachments) contains 
>>confidential information intended for a specific 
>>individual and purpose, and is protected by law. 
>>If you are not the intended recipient, you should 
>>delete this message and are hereby notified that 
>>any disclosure, copying, or distribution of this
>>message, or the taking of any action based on it, 
>>is strictly prohibited.
>>
>>*********************************************************
>>Visit us at http://www.mahindrabt.com
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


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


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Session management

Posted by Navjot Singh <na...@net4india.net>.
struts has nothing to do with managing sessions. we should better 
talk about servlet containers that handles sessions.

btw, 100 sessions are nothing to worry about :-)

leave the txn mgmt to db layer. use any of the persistence frameworks
that can handles this for you.

>-----Original Message-----
>From: Parag [mailto:mparag@mahindrabt.com]
>Sent: Tuesday, February 24, 2004 2:44 PM
>To: Struts Users Mailing List
>Subject: Session management
>
>
>Experts,
>
>We are planning to build an application, for which expected 
>concurrent users
>are ~100. Total usrs being 2000.
>
>Does Struts provide any facilities to manage Sessions on such scale?
>
>Some of the functionality is very data intensive, and would need 
>transaction
>management. What is the prefered way of doing so? Are there any facilities
>in Struts
>
>All your comments are highly appreciated.
>
>Regards
>Parag
>
>*********************************************************
>Disclaimer
>
>This message (including any attachments) contains 
>confidential information intended for a specific 
>individual and purpose, and is protected by law. 
>If you are not the intended recipient, you should 
>delete this message and are hereby notified that 
>any disclosure, copying, or distribution of this
>message, or the taking of any action based on it, 
>is strictly prohibited.
>
>*********************************************************
>Visit us at http://www.mahindrabt.com
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Session management

Posted by Parag <mp...@mahindrabt.com>.
Experts,

We are planning to build an application, for which expected concurrent users
are ~100. Total usrs being 2000.

Does Struts provide any facilities to manage Sessions on such scale?

Some of the functionality is very data intensive, and would need transaction
management. What is the prefered way of doing so? Are there any facilities
in Struts

All your comments are highly appreciated.

Regards
Parag

*********************************************************
Disclaimer

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Role based access?

Posted by Navjot Singh <na...@net4india.net>.
in this case, Form is decalratively saying that it can be accessed only by
"userRole".
Now when you use CMA, every user will be bound to to a role.

RequestController compare the two roles one from user-in-request and other
from
ActionMapping/ActionConfig and continue..

However, you can also override the default behaviour of processRoles and go
your own way.

HTH
Navjot Singh

-----Original Message-----
From: subramaniam.o@tcs.com [mailto:subramaniam.o@tcs.com]
Sent: Wednesday, February 18, 2004 8:49 PM
To: Struts Users Mailing List
Subject: Role based access?



Hi Guys,

Struts-config.xml
                <action attribute="Form"   roles="userRole">

How do i use this 'roles' attribute to implement role-based access.

Thanks and Regards

Subramaniam Olaganthan
Tata Consultancy Services
Mailto: subramaniam.o@tcs.com
Website: http://www.tcs.com


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org