Create a concrete SecurityTool class implementing the ApplicationTool interface and that wraps the calls to the JetspeedSecurity system.
> -----Message d'origine----- > De : Aurelien Pernoud [mailto:apernoud@;sopragroup.com] > Envoy� : jeudi 14 novembre 2002 10:17 > � : 'Jetspeed Users List' > Objet : Test a role inside a template ? > > > > Hi, > > I'd like to test if a user has a defined role, in a template. > In a class I used the jetspeedSecurity class > (org.apache.jetspeed.services.JetspeedSecurity), and it works fine. > > So i simply put this in tr.pr : > tool.request.jsecurity=org.apache.jetspeed.services.JetspeedSe > curity and > tried to use it inside velocity... > > But this class is abstract (every method are static and call the > "getservice"), so it seems velocity can't use it ? > > What's in my template : > $jsecurity.hasRole($data.User.UserName,"admin") > > To see if the current user is an admin... It doesn't work. > > Any idea ? > > Aur�lien Pernoud > > > -- > To unsubscribe, e-mail: <mailto:jetspeed-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:jetspeed-user-help@;jakarta.apache.org> -- To unsubscribe, e-mail: <mailto:jetspeed-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:jetspeed-user-help@;jakarta.apache.org>
