You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by xianwinwin <xi...@gmail.com> on 2009/01/01 00:03:22 UTC

s2: howto protect a method with annotation

Hi all,

I have a class with different methods. I have 2 type of users:
Employee and Manager

my XML looks like this:

<action name="work_*"  method="{1}" class="com.struts.WorkAction">			
    <result name="file" type="tiles">fileLayout</result>
.
.
.
									
            <interceptor-ref name="user"/>            
</action>  


I realized that one of the method should be performed only by Manager. Is
there anyway, using annotation, to prevent employee from pressing a certain
button (that leads to execution of the method)

THANK YOU!


-- 
View this message in context: http://www.nabble.com/s2%3A-howto-protect-a-method-with-annotation-tp21237786p21237786.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: s2: howto protect a method with annotation

Posted by Martin Gainty <mg...@hotmail.com>.
the easiest way is to code 2 different actions

the other is to code the (jsp's) as a Portlet with Jetspeed and to mask off each of the included jsps by checking credentials

Martin
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




> Date: Wed, 31 Dec 2008 15:03:22 -0800
> From: xianwinwin@gmail.com
> To: user@struts.apache.org
> Subject: s2: howto protect a method with annotation
> 
> 
> Hi all,
> 
> I have a class with different methods. I have 2 type of users:
> Employee and Manager
> 
> my XML looks like this:
> 
> <action name="work_*"  method="{1}" class="com.struts.WorkAction">			
>     <result name="file" type="tiles">fileLayout</result>
> .
> .
> .
> 									
>             <interceptor-ref name="user"/>            
> </action>  
> 
> 
> I realized that one of the method should be performed only by Manager. Is
> there anyway, using annotation, to prevent employee from pressing a certain
> button (that leads to execution of the method)
> 
> THANK YOU!
> 
> 
> -- 
> View this message in context: http://www.nabble.com/s2%3A-howto-protect-a-method-with-annotation-tp21237786p21237786.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
It’s the same Hotmail®. If by “same” you mean up to 70% faster.
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008

Re : s2: howto protect a method with annotation

Posted by François Rouxel <ro...@yahoo.com>.
Yes sure
You can use an interceptor 

<interceptor-refname="roles"></interceptor-ref>
 
as simple as that :-)
 
fr/
 <paramname="allowedRoles">Manager</param>____________________________________________ ____________________________________________ 



----- Message d'origine ----
De : xianwinwin <xi...@gmail.com>
À : user@struts.apache.org
Envoyé le : Mercredi, 31 Décembre 2008, 18h03mn 22s
Objet : s2: howto protect a method with annotation


Hi all,

I have a class with different methods. I have 2 type of users:
Employee and Manager

my XML looks like this:

<action name="work_*"  method="{1}" class="com.struts.WorkAction">            
    <result name="file" type="tiles">fileLayout</result>
.
.
.
                                    
            <interceptor-ref name="user"/>            
</action>  


I realized that one of the method should be performed only by Manager. Is
there anyway, using annotation, to prevent employee from pressing a certain
button (that leads to execution of the method)

THANK YOU!


-- 
View this message in context: http://www.nabble.com/s2%3A-howto-protect-a-method-with-annotation-tp21237786p21237786.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


      

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