[Zope] RE: What method do I use to check access?
Martijn Pieters
mj@antraciet.nl
Tue, 11 May 1999 14:23:08 +0200
At 01:28 11/05/99 , Jay, Dylan wrote:
> > Jay,
> >
> > Try <!--#if "AUTHENTICATED_USER.has_role('foo')"-->. There was an
> > excellent posting in the archives about all the possibilities with the
> > user object. Also read the files in the AccessControl folder inside
> > Zope/lib/python.
>
>the has_role method I already use and is not convienient as it means I have
>to hard code the roles.
>I've looked in AccessControl and only come across
>def allowed(self,parent,roles=None):
>but was unsuccessful in getting it to do what I want.
>
>I will look for that email in the archives.
AUTHENTICATED_USER.allowed won't do what you want, I think. A now
deprecated method that is now replaced by has_role was nothing more than an
alias to the allowed() method, so you cannot get any (or much) more
information from allowed() than you can get from has_role().
Explain to us what you want to do.
--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------