[Zope] Get current username within pythonscript
Dieter Maurer
dieter@handshake.de
Wed, 29 Jan 2003 21:15:06 +0100
pskipwort@touchcorp.com wrote at 2003-1-29 11:47 +1100:
> Can someone tell me how to do this within a PythonScript ?
> I've tried
>
> from AccessControl import getSecurityManager
> username=getSecurityManager.getUser().getUserName()
Use:
username=getSecurityManager().getUser().getUserName()
"getSecurityManager" is a function.
You must call it to get the security manager (which then has
the method "getUser").
Dieter