[Zope-CMF] Forcing skins by role

Paul Winkler pw_lists@slinkp.com
Fri, 23 Aug 2002 16:35:20 -0700


On Fri, Aug 23, 2002 at 04:11:53PM -0700, Paul Winkler wrote:
> > 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.

Just to elaborate: a bit more investigation proves the
above reasoning is false. 
REQUEST.get('AUTHENTICATED_USER') returns an actual
user object complete with has_roles(). But 
even so, calling it in an access rule seems to always give
'Anonymous User' as fas as I can tell.

So apparently, this REQUEST variable is actually inserted
in teh REQUEST sometime after access rule is called.

Looks like I'm going to need to go in a different direction.
Maybe I can have a method that sets the skin and is always
called by my main_template of every skin.

--

Paul Winkler
"Welcome to Muppet Labs, where the future is made - today!"