[Zope] Requesting AUTHENTICATED_USER from within Python script?

Joachim Werner joe@iuveno-net.de
Wed, 26 Sep 2001 19:56:49 +0200


----- Original Message ----- 
From: <olpa@sybcom.de>
To: <zope@zope.org>
Sent: Wednesday, September 26, 2001 5:18 PM
Subject: [Zope] Requesting AUTHENTICATED_USER from within Python script?


> 
> Blame me if this is already answered:
> 
> how to check if current role is Manager and how is the name of the
> authenticated user from within a Script (Python)... i.e. how to do
> AUTHENTICATED.has_role('Manager') and AUTHENTICATED_USER.getUserName()
> without passing AUTHENTICATED as argument.
> 
> Is this in context ?

Yep, it is part of REQUEST, which is available via context, e.g.

"context.REQUEST.AUTHENTICATED_USER.has_role('Manager')" would work

Joachim