[Zope-CMF] Access rule for setting skin

Dieter Maurer dieter at handshake.de
Mon Apr 4 14:23:05 EDT 2005


Jean-Francois.Doyon at CCRS.NRCan.gc.ca wrote at 2005-4-4 11:37 -0400:
> ...
>As I think I'd mentionned, I get the Zope default home home page (Welcome to
>Zope, etc ...), but with a big warning at the top telling me that I don't
>have an administrative user setup and so on ... Which is obviously not true
>:)

Fine. But, I am unable to keep track of everything written in a thread...

>Further reading has suggested that the problem might be because the hook
>occurs before any authentication occurs, so the changeSkin() method will not
>work properly, or something like that?  Saw some archived list discussions
>on this topic ... Post-authentication hook?

This should only be a problem when your "changeSkin" decision
were based on specific user identities or authorization.
Such information is not available in an "AccessRule" as
authentication is performed after traversal (while "AccessRules"
are executed during traversal).

>In fact I believe you have a patch for it on your site?

Yes -- for a post-authentication hook.

But, as explained, it will not help for your current problem.

>Putting the access rule higher I'm guessing wouldn't work.  It's already in
>the root of the CMF site.  Putting it in the root of the entire zope
>instance would move it outside the CMF, and changeSkin() would no longer be
>easily available, or work properly? (Admitedly, haven't tried it yet).

Of course, you would need to "traverse" to the object which defines
"changeSkin"...

>If that's not it, I also discovered a co-worker developped a custom class
>that does what I need by using registerBeforeTraverse.  I think I may do
>that anyways as it allows my code to be on the FS and version controlled and
>so on.

Fine!

-- 
Dieter


More information about the Zope-CMF mailing list