[Zope-CMF] Access rule for setting skin

Jean-Francois.Doyon at CCRS.NRCan.gc.ca Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Mon Apr 4 11:37:22 EDT 2005


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
:)

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?

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

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).

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.

Thanks as always!
J.F.

-----Original Message-----
From: Dieter Maurer [mailto:dieter at handshake.de] 
Sent: April 3, 2005 1:54 PM
To: Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Cc: zope-cmf at zope.org
Subject: Re: [Zope-CMF] Access rule for setting skin

Jean-Francois.Doyon at CCRS.NRCan.gc.ca wrote at 2005-4-1 17:43 -0500:
> ...
>So for instance I have a CMF root at /site/atlas ... This works fine.  
>The view is "root_view" (A FS based PT in the skins).
>
>If I do /site/atlas/en or /site/atlas/fr, I get something entirely 
>unexpected.

It might help to explain what you get...

>If I do /site/atlas/en/root_view or /site/atlas/fr/root_view, then I'm 
>back in business.
>
>I'm guessing this has something to do with when the access rule 
>actually gets called and so on (too early? Too late?).

Indeed. Both the "AccessRule" as well as the "default view" resolution use
the so called "__before_publishing_traverse__" hook.
You probably see a conflict for this ressource.

A workaround might be to move your "AccessRule" up in the hierarchy (such
that it does not change the "__before_publishing_traverse__"
of a content object).

--
Dieter


More information about the Zope-CMF mailing list