You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Aurelien Pernoud <ap...@sopragroup.com> on 2002/11/14 10:17:13 UTC

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.JetspeedSecurity 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>