[Zope] problem testing for a permission

ethan mindlace fremen mindlace@digicool.com
Fri, 20 Apr 2001 13:43:22 -0400


--On Friday, April 20, 2001 10:19:26 +0200 Jerome Alet <alet@unice.fr> 
wrote:
> On Thu, 19 Apr 2001, ethan mindlace fremen wrote:
>> you don't want to evaluate truth: you want to see if there's an
>> exception.

I think I was wrong.

> the permissions on "my_method" are normal, except View which is only
> allowed to roles Manager and Member, and not acquired.

I implemented it like this:

method you want to show is test,
method that shows the link is canIsee,
python script that tests is called showme.

showme:

if context.REQUEST.AUTHENTICATED_USER.has_permission('View','test'):
   return '<a href="test">test</a>'
else:
   return ''

canIsee:
<dtml-var showme>

test:
this just has the permissions set as you said.

That should do it!
--
ethan mindlace fremen
zopatista community liason