Forgot to mention that my portlet is not visible (hidden=true in xreg) so I can't use the JetspeedTool ... (it uses the user psml).
> -----Message d'origine----- > De : Aurelien Pernoud [mailto:apernoud@;sopragroup.com] > Envoyé : jeudi 14 novembre 2002 10:40 > À : 'Jetspeed Users List' > Objet : RE: Test a role inside a template ? > > > Like this idea, thanks a lot ! > This way if I understand I simply put one tool in tr.pr and > this tools is a > global access to whatever I want (in my case I already use > portletfactory > ...) > > BTW I'd like to be sure I'm using the portletfactoryservice > the right way (I > saw it was yours ;)) : > > $portletfactory is org.apache.jetspeed.services.PortletFactory in this > sample > (next I'll try the use of one global tool) > > I'm in a template, and if the user is not an admin, then I > want to get the > content of one specific portlet. here's what I did : > <center> > > $portletfactory.getPortlet("Portlet_Role","1").getContent($data) > </center> > > I put "1" as portlet id cause didn't know what to put > there... I don't want > the user to be able to delete this portlet (I only get its > content, not the > looking around). > It seems to work, but don't know why there's no getPortlet(String > portletName) only ? > > Thanks again, > Aurelien > > > -----Message d'origine----- > > De : Luta, Raphael (VUN) [mailto:Raphael.Luta@;groupvu.Com] > > Envoyé : jeudi 14 novembre 2002 10:29 > > À : 'Jetspeed Users List' > > Objet : RE: Test a role inside a template ? > > > > > > 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> > > > > > -- > 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>