[Zope-CMF] Forcing skins by role

alan runyan alan runyan" <runyaga@runyaga.com
Sat, 24 Aug 2002 02:07:20 -0500


it sounds like you want a pre-processor directive in your PageTemplates.
there has been some talk on ZPT mailing list about this.  You basically
want to 'set up' your ZPT context before its rendered.

I am very surprised there isnt a hook after the Authentication machinery has
happened.
I havent needed this yet.  But i would imagine its possible in some way
shape or form.
just requires some Zen and maybe even a monkey patch ;p

~runyaga

----- Original Message -----
From: "Paul Winkler" <pw_lists@slinkp.com>
To: <zope-cmf@zope.org>
Cc: "Paul Winkler" <pw_lists@slinkp.com>
Sent: Friday, August 23, 2002 6:11 PM
Subject: Re: [Zope-CMF] Forcing skins by role


> On Fri, Aug 23, 2002 at 03:04:52PM -0700, Paul Winkler wrote:
> > On Fri, Aug 23, 2002 at 08:21:26PM +0200, Dieter Maurer wrote:
> > > I doubt that this can work:
> > >
> > >   When the AccessRule fires, the user is not yet authenticated.
> > >
> > >   I expect, "getAuthenticatedMember" will always return
> > >   "Anonymous User".
> >
> > God damn that's strange, but it appears
> > you're right.  After updating CMF from CVS
> > and using context.changeSkin(skin_name)
> > instead of setupCurrentSkin(REQUEST),
> > I've found that the skin is reliably set to
> > whatever I put in the "not manager" case.
> >
> > Ugh.  Let me see if I can make it work
> > based on the AUTHENTICATED_USER value
> > in the REQUEST.
>
> ... and the answer is: not any way that I can think of. :(
> I can look up the user's name in acl_users ( and hope it's
> the right one), but I get back a plain vanilla User object,
> not AuthenticatedUser, so I don't get a useful has_roles
> method.
>
> Is it really the case that nobody has ever done  a site
> that skins based on user roles? That's amazing to me.
> I can think of all kinds of uses for it.
>
> --PW
> --
>
> Paul Winkler
> "Welcome to Muppet Labs, where the future is made - today!"
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>