[Zope-CMF] Forcing skins by role

Paul Winkler pw_lists@slinkp.com
Thu, 22 Aug 2002 23:02:29 -0700


Hi,

I'd like users to a CMF site I'm working on to
see one of two skins, based on whether or not the user has
a role.

Aside from a long detour down a horrible hack that ended
up nowhere, I've tried a python script / Access Rule
setup similar
to what Carl Rindell posted on 7/31/02, but I can't 
get it working.

Here's my access rule - it's a script (python) obviously:

who = context.portal_membership.getAuthenticatedMember()
if who.hasRole(context, ['Manager']):
   newskin = 'Skin A'
else:
   newskin = 'Skin B'
REQUEST.set('portal_skin', newskin)
context.setupCurrentSkin(REQUEST)


As far as I can tell, this doesn't do a damn thing.
I always get the skin set as default in the portal_skins
properties view. And yes, I'm really testing both with managers
and non-managers.

Any thoughts on what might be wrong, or a better approach?


--

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