[Zope] Get current username within pythonscript

Dylan Reinhardt zope@dylanreinhardt.com
Wed, 29 Jan 2003 07:37:57 -0800


You could do that too... but since AUTHENTICATED_USER is deprecated, I 
prefer to use the SecurityManager.

Either will do the job, though.

Dylan

At 07:24 PM 1/28/2003, David Bear wrote:
>On Tue, Jan 28, 2003 at 05:23:39PM -0800, Dylan Reinhardt wrote:
> > Try:
> >
> > from AccessControl import getSecurityManager
> > return getSecurityManager().getUser()
> >
>how about:
>
># Returns the name of the current authenticated user
>return(context.REQUEST.AUTHENTICATED_USER.getUserName())
>
>--
>David Bear
>College of Public Programs/ASU
>Mail Code 0803