[Zope] Error: AUTHENTICATED_USER.hasRoles()

Luciano Ramalho luciano@hiper.com.br
Wed, 04 Apr 2001 13:44:31 -0300


The method you're trying to use is called has_role() and not hasRoles().

Here are some examples of usage:

<dtml-var "AUTHENTICATED_USER.has_role('Manager')">
Returns true if one of the user's roles matches the one given.

<dtml-var "AUTHENTICATED_USER.has_role(['Manager',
'Knight_of_the_Round_Table'])">
Returns true if one of the user's roles matches one of the listed roles.

__Luciano



Gitte Wange wrote:
> 
> Hello,
> 
> I can't figure out what arguments the hasRoles function takes.
> I have tried a lot but it all gives an attribute error.
> 
> I have these 2 roles - StationMan and ChannelMan - and I need to test
> whether the logged-in user is either one of them.
> 
> But what arguments must I pass to the function ?
> 
> --
> ************************
> Gitte Wange Jensen
> 
> System Squid Developer
> MMManager Aps
> +45 29 72 79 72
> 
> gitte@mmmanager.org
> ************************
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )