[Zope-CMF] User roles

Adrian Madrid aem@byu.edu
Thu, 5 Apr 2001 18:14:41 -0700 (PDT)


I tried this <dtml-if
rolesUser>x<dtml-else>y</dtml-if>
but I get a TypeError: not enough arguments; expected
1, got 0.

And then I tried I tried this <dtml-if
rolesUser(_)>x<dtml-else>y</dtml-if>
but I get y all the time even though the user has the
'Translator' role.


--- Shane Hathaway <shane@digicool.com> wrote:
> Adrian Madrid wrote:
> > 
> > Sorry to be python illiterate but how do I get a
> list
> > of those roles? I tried creating a python script
> like
> > this one:
> > 
> > # Get all roles defined in user folder.
> > if 'Translator' in
> > SecurityManager().getUser().getRoles():
> >     return 1
> > else:
> >     return 0
> > 
> > with _ as a parameter and then I called the script
> as:
> > 
> > <dtml-if "userRoles">x<dtml-else>y</dtml-if>
>            ^^^^^^^^^^^
> You need to remove the quotes or use "name=". 
> <dtml-if
> name="userRoles"> is the same as <dtml-if
> userRoles>.  <dtml-if
> "userRoles"> is the same as <dtml-if
> expr="userRoles">.
> 
> Shane
> 
> _______________________________________________
> 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


=====
---------------------------
Adrian Esteban Madrid
Benson Institute, Webmaster
Brigham Young University
---------------------------
adrian_esteban@madrid.com
===========================

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/