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 <xianwin...@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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




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

Reply via email to