[Zope] AUTHENTICATED_USER

Brian Lloyd Brian@digicool.com
Tue, 2 Mar 1999 08:58:23 -0500


> Does anyone have any more information on AUTHENTICATED_USER? 
> We saw a while 
> back that it has properties (AUTHENTICATED_USER.has_role(['Manager', 
> 'Editor'])). I would like to be able to get the user name, 
> and use that to 
> index simple files for users. Is there something like 
> AUTHENTICATED_USER['UserName']?? This is essentially the 
> information that is 
> returned if you try <!--#var AUTHENTICATED_USER-->. However, 
> if you try 
> something like <!--#if "AUTHENTICATED_USER in 
> objectIds()"-->, it does not 
> work.

AUTHENTICATED_USER itself is an object -- the reason
<!--#var AUTHENTICATED_USER--> gives you the user name
is that it effectively does an str() on the user object.

To work with the user name directly, you can use the
getUserName() method of the user object:

<!--#if "AUTHENTICATED_USER.getUserName() in objectIds()"-->


Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com