[Zope-CMF] how do I get autenticated user

Jens Vagelpohl jens@zope.com
Mon, 26 Nov 2001 08:53:19 -0500


what version of zope are you using?

some versions prior to 2.4.1 or so had a "shortcut" in the security 
mechanism which applied to objects that were publicly accessible. it sped 
up security processing a little but as a side affect the user would appear 
to be anonymous during the execution of publicly accessible code.

jens


On Monday, November 26, 2001, at 08:47 , Robert Rottermann wrote:

> Hi there,
>
> I try to get the authenticated user from within breadcrumbs.py
> I tried it as follows but it does not work.
>
> Thanks
> Robert
>
> portal = context.portal_url.getPortalObject()
> pm =  context.getToolByName(portal, 'portal_membership')
> member = pm.getAuthenticatedMember()
>
> if(mtool.getAuthenticatedMember.hasRole( context, ['Mitarbeiter'] )):
>    root_url = "%s/folder_contents" % portal_url
> else:
>    root_url = portal_url
>
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature 
> requests