[Zope-CMF] Re: _checkPermission problems

Shane Hathaway shane@digicool.com
Thu, 28 Jun 2001 13:45:39 -0400


seb bacon wrote:
> So, I looked at PortalContent again, and you've changed it so it can
> verify object permissions as we discussed some time ago, this time by
> overriding __call__ and doing the following trick:
> 
>  index_html = None  # This special value informs ZPublisher to use __call__

Right.  The ComputedAttribute access occurred before authentication, but
the invocation of __call__ occurs after authentication.

> Now, my problem (and this is where I start drowning), is that I'm
> already overriding __call__ to hook BeforeTraverse.  I'm not even sure
> how to use BeforeTraverse, I just copied some code from SiteAccess.
> But AFAICT, once you've registered an object with BeforeTraverse, it
> hooks to the __call__ of the object?

I see.  BeforeTraverse hooks are invoked before authentication.  You
probably don't want the same object to be content and provide a
BeforeTraverse hook at the same time.

> I can't mix my BeforeTraverse and my index_html/__call__ code, because
> they do different things.
> 
> Any ideas how I can extricate myself from this mess?

Just a few more details on what you're accomplishing would help.  How is
BeforeTraverse involved?

Shane