[Zope] Authenticated user in Session onAdd methods?

Dieter Maurer dieter@handshake.de
Fri, 30 Aug 2002 22:42:03 +0200


=?iso-8859-1?Q?Juan_Carlos_CORU=D1A?= writes:
 > I want to incluye some default values in a session data container when
 > it instantiates.
 > 
 > I created a python script that called when new session is created. The
 > problem is hat I need to know the user name in order to setup the
 > default session values.
 > 
 > For example:
 > 
 > sdo['UserName'] = <way to obtain the username>
 > 
 > I tried:
 > sdo['UserName'] = _.SecurityGetUser().getUserName()
 > and the result is always "Anonymous User" even if I am logged as an
 > authenticated user.
The session may be created too early, before authentication.

I had hoped (and still do) that usually a session is only created
after authentication.

  Do you use it somewhere in an AccessRule or other traversal hooks?


Dieter