[Zope] Authentication

Philip Aylesworth zopelist@regalint.com
Fri, 30 Apr 1999 16:06:23 -0400


Brian Lloyd wrote:
> 
> > Brian Lloyd wrote:
> > >
> > > You need to use the has_role method, not hasRole (hasRole
> > is deprecated,
> > > and suffered from a poor choice of name, since it was the original
> > > name of user.allowed. the name exists solely for b/w compatibility).
> > >
> > I am using hasRole so when I saw this I tried changing it to has_roll.
> > But has_roll gives me an error. Is the sytax different? I am
> > using Zope
> > 1.10.2 on RedHat Linux 5.2.
> >
> > <!--#call
> > "REQUEST.set('isManager',AUTHENTICATED_USER.has_role(_.None,['
> > Manager']))"-->
> >
> > PS I stole this from Zope.org a while back. :)
> >
> > Phil A.
> 
> I think you're giving too many arguments to has_role - it is
> already bound to AUTHENTICATED_USER, so the following _should_
> work:
> 
> <!--#call "REQUEST.set('isManager',
>            AUTHENTICATED_USER.has_role(['Manager'])
>            )"-->
> 

Ooooo! That works nicely. Much cleaner, too!

Thanks,

Phil. A.