[Zope-CMF] change skin based on use property

Shane Hathaway shane@zope.com
Mon, 30 Sep 2002 23:57:37 -0400


alan runyan wrote:
> iirc we need to have a hook exposed in ZPublisher.  I believe
> there is a similiar thread on PageTemplates where they want a
> "pre rendering" of PageTemplate hook exposed to them as well.
> It seems this feature is certainly needed.  The question is --
> who will implement it ?

In reality, the publisher would have to change dramatically in order to 
support this.  You see, here's what's going on:

1) Zope traverses to a CMF site.
2) A skin is chosen.
3) Zope finishes traversal, traversing all the way to a specific method 
in a skin.
4) Zope does authentication.
5) Zope checks whether the user actually has access to the skin method.
6) Zope calls the method.

So even if we had a hook after authentication, Zope has already chosen 
what method to call, and changing the skin won't have any effect.  It 
would be wasteful to make Zope go back and traverse again.  The solution 
is that Zope needs to attempt authentication and authorization during 
traversal, rather than after, which would improve both access rules and 
security in general.

Fortunately, this is already the thinking for Zope 3.

Shane