[Zope-CMF] checking for local role

Joseph Bella joe_bella@yahoo.com
Wed, 24 Jul 2002 15:33:05 -0700 (PDT)


What would be the best way to check to see if a
particular user has a particular local role granted to
him somewhere within the tree (but not necessarily in
the current context)?

joe

--- Tres Seaver <tseaver@zope.com> wrote:
> On Wed, 2002-07-24 at 15:52, Bryan C. Andregg wrote:
> > I've tried several variations of:
> > 
> > tal:condition="python:
> >  
>
here.portal_membership.getAuthenticatedMember().has_role('Foo')"
> > 
> > As a way of checking for the local role Foo, but
> this always returns false.
> > 
> > What is the proper syntax for testing for a local
> role?
> 
> To check for local roles, you need to pass context,
> e.g.:
> 
>  tal:condition="python:
>   
>
here.portal_membership.getAuthenticatedMember().has_role('Foo',here)"
> 
> Tres.
> -- 
>
===============================================================
> Tres Seaver                               
> tseaver@zope.com
> Zope Corporation      "Zope Dealers"      
> http://www.zope.com
> 
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
> 
> See http://collector.zope.org/CMF for bug reports
> and feature requests


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com