[Zope-CMF] how do I get autenticated user
Jeffrey P Shell
jeffrey@cuemedia.com
Mon, 26 Nov 2001 13:33:37 -0700
'getToolByName()' is not exposed to Python Scripts (to the best of
my knowledge). You can get portal_membership by doing straight
acquisition, the same way you got portal_url::
pm = context.portal_membership # acquire portal_membership tool
On Monday, November 26, 2001, at 06:47 AM, 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