AW: [Zope] Do All Classes Have Default Current Objects? REQUEST.A UTHENTICATED_USER.getUserName()

H.de.Wit@SFK.NL H.de.Wit@SFK.NL
Wed, 24 Oct 2001 10:16:09 +0200


>Allmost this works:
> user = container.REQUEST.AUTHENTICATED_USER.getUserName()

REQUEST.AUTHENTICATED_USER method is not advised by the zope documentation:
>From your zope installation\lib\python\PRODUCTS\OFSP\help\dtml-funcs.stx:

    SecurityGetUser() -- Return the current user object. This is
    normally the same as the 'REQUEST.AUTHENTICATED_USER'
    object. However, the 'AUTHENTICATED_USER' object is insecure since
    it can be replaced.

>From the book chapter 6, performing security checks:

<dtml-var expr="_.SecurityGetUser().getUserName()">
You can retrieve the currently logged in user with the SecurityGetUser
etc..

However, i was not able to use this function from within a pythonscript.
I am sure somebody else can do that, i am interested in the solution, so if
you have one...

Met vriendelijke groeten,

Hans de Wit
Stichting Farmaceutische Kengetallen
Postbus 30460
2500 GL  DEN HAAG
Tel. 070-3737448
Fax 070-3737445