[Zope] hasRole syntax ?
Brian Lloyd
brian.lloyd@zope.com
Wed, 29 Aug 2001 14:19:05 -0400
> In a dtml document, if i use
> <dtml-var expr="AUTHENTICATED_USER.hasRole('xyz')">
> i received a 1 for any value of xyz
> if i use the syntax
> <dtml-var expr="AUTHENTICATED_USER.has_role('xyz')">
> i will receive 0 if i'm not a member of the group
> and 1 if i am a member, which is the correct behavior
>
> Which syntax is the correct one?
> Any explanation why the first syntax is not correct?
To find out whether the user has the given role, you should
use has_role().
hasRole is a very very old method that is deprecated, though
I just looked and found that the help system (and possibly
the documentation) lists it (and omits has_role, has_permission
and other things that should be there).
I've copied the documentation guys on this. Amos or Mike, can
we get this fixed for 2.5?
Brian Lloyd brian@zope.com
Zope Corporation www.zope.com