[Zope] Checking Authenticated User Name???

Dieter Maurer dieter@handshake.de
Thu, 11 Apr 2002 21:25:06 +0200


Jason Burke writes:
 > ...
 > What's the best way to query the logged in user's name in a
 > python script (not external script and not with DTML)?
 > 
 > The API docs mention something about an AuthenticatedUser
 > class, but I can't find the object anywhere in my ./Zope/lib/python
 > directory, and it doesn't appear to be a class in any of the zope
 > modules that I searched through.
 > 
 > I did notice a reference to something like this...
 > 
 > REQUEST.AUTHENTICATED_USER.getUserName()
 > 
 > but, this doesn't seem like it would be any more secure than
 > just assigning REQUEST.AUTHENTICATED_USER to a
 > variable.
"getSecurityUser()" gives you the user object.
"getUserName()" gives you its name.


Dieter