[Zope] Pb getting local roles ... strange

Shane Hathaway shane@digicool.com
Fri, 18 Aug 2000 11:28:26 -0400


Didier Georgieff wrote:
> 
> Hello,
> 
> I'm on 2.1.6.
> I'm trying to have an information box with all roles.
> 
> <dtml-in "AUTHENTICATED_USER.getRoles()">
>  <dtml-var sequence-item>
> </dtml-in>
> 
> works OK. But doesn't give the local roles.
> So i tried
> 
> <dtml-with URL0>
>  <dtml-in "get_local_roles()">
>   <dtml-var sequence-item>
>  </dtml-in>
> </dtml-with>
> 
> But it only gives ['owner'] and not the other local role ['roleFoo'].
> But the response is correct if i test with
> 
> <dtml-if "AUTHENTICATED_USER.has_role('roleFoo',this())"> is
> True.
> 
> Is it a bug or a misunderstanding ? I found nothing on the archives.
> Thanks in advance.

Have you tried AUTHENTICATED_USER.getRolesInContext(this())?

Shane