[Zope] RE: What method do I use to check access?

Bill Anderson bill.anderson@libc.org
Wed, 26 May 1999 01:53:19 -0600


> I've looked at rolesOfPermission etc and they don't seem to give what I want
> in that they
> don't recursivly check parent permissions if permissions are aquired. What I
> really want is an easy way conditionally include something based on weather
> the user can view it (or maybe another permission). I don't want to have to
> hard code the roles as this is duplicating code.
> What I want is
> <!--#if "AUTHENTICATED_USER.hasPermission(SomeObject, 'View')"-->
>  <a href="<!--#var "SomeObject.absolute_url()"-->">Goto SomeObject</a>
> <!--#/if-->
> 
> The link will only appear if the user can actually go to it. This must be
> possible as somewhere in the code this validation must happen already. I've
> tried looking but really need some help.

I don't normally do this, but: Me Too :-)

Seriously, if there is a simple way to do it (preferably like the
above), I am all ears(eyes)!