[Zope] hasRole (Bug or My brain is dead?)

The Doctor What docwhat@gerf.org
Thu, 19 Apr 2001 09:51:30 -0500


--gatW/ieO32f1wygP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Okay, I have this in a dtml method called by a dtml document...
(This does the same, btw from the dtml document directly)

<hr>
<dtml-var expr=3D"_.SecurityGetUser().getUserName()">
<br>
<dtml-var expr=3D"AUTHENTICATED_USER.hasRole('Manager', index_html)">
<br>
<dtml-var expr=3D"AUTHENTICATED_USER.hasRole('Manager')">
<br>
<dtml-var expr=3D"'Manager' in _.SecurityGetUser().getRoles()">
<br>

 From a non-logged in browser I get:
        Anonymous User
        1
        1
        0

 From a logged in browser (with Manager Role):
        docwhat
        1
        1
        1

The problem here is that AUTHENTICATED_USER does *not* have the role
of 'Manager', despite zope's claims to the contrary!

I have tried swapping in and out _.SecurityGetUser() for
AUTHENTICATED_USER and have made sure this isn't a caching/proxy
problem.

Am i brain dead here?  This is zope 2.3.1

I am currently using the last one (as it works) but shouldn't the
first ones work too?

Ciao!

--=20
A hacker does for love what others would not do for money.

The Doctor What: Need I say more?                http://docwhat.gerf.org/
docwhat@gerf.org                                                   KF6VNC

--gatW/ieO32f1wygP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE63vtykJDks3INMZURAuK8AKDhITIkXnj7bPYZItvo6e0ovf2jtwCgrV4U
V9t74NMoM1YAUtxMX7Tru0E=
=+e4E
-----END PGP SIGNATURE-----

--gatW/ieO32f1wygP--