[Zope] Python version of a DTML thing

Chris Withers chrisw@nipltd.com
Tue, 18 Jun 2002 06:41:49 +0100


Jim Washington wrote:
> 
> I did some digging, and the following will work:
> 
> from AccessControl import getSecurityManager
> sm = getSecurityManager()
> user = sm.getUser()
> username = user.getUserName()

This is the correct way to do things in a python script.

There may be (or should be? ;-) a utility method to get he current user or user
name immediately bu, in any case, the above has less overhead and connotations
that binding hte namespace...

cheers,

Chris