[Zope-CMF] Forcing skins by role

Shane Hathaway shane@zope.com
Fri, 23 Aug 2002 09:43:36 -0400


Paul Winkler wrote:
> 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.
> (snip) 
> 
> 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)

Try updating to the current CMF CVS and changing the last two lines to 
the following:

context.changeSkin(newskin)

It was just added this week.

Shane