[Zope-CMF] User roles

Shane Hathaway shane@digicool.com
Thu, 05 Apr 2001 21:46:17 -0400


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

This means that either rolesUser() wants one argument to be passed in or
something it calls wants one argument.  

> 
> 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.

Good try, but you bumped against the "expr" confusion again.  This time
it's looking for something named "rolesUser(_)" and, since nothing by
that name exists, the condition evaluates to false.  Try figuring out
what wants the argument.  If rolesUser() really does need an argument,
you can invoke it like this: <dtml-if expr="rolesUser(somearg)">

Shane