11 Apr
2002
11 Apr
'02
7:25 p.m.
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