[Zope-CMF] cannot get authenticated user

Kevin Carlson khcarlso@bellsouth.net
Fri, 18 Oct 2002 14:24:38 -0400


Try portal_membership.getAuthenticatedMember() instead.

Kevin

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Rocky Mazzeo
Sent: Friday, October 18, 2002 1:27 PM
To: zope-cmf@zope.org
Subject: [Zope-CMF] cannot get authenticated user


Under the hood question:
I'm trying to extend Products.CMFCore.SkinsTool for a personal project.
Basically I want to over-ride getSkinByName to run little logic and return
the skin based on Role/Permission/URL.

I am running into a stumbling block in that 'getSecurityManager.getUser()'
is always returning the Anonymous User. I removed the CookieCrumbler (hoping
it was just that it hadn't been called yet), but even standard HTTP
Authentication Headers are returning the Anonymous User.

Is it possible to get the User object at this level? Can someone offer
advice as to what I could be missing? Here is a stripped down version of my
class:

class CMFSkinsToolRules(SkinsTool):
  #...
  def getSkinByName(self,name):
    #...
    strSkinName = self.getSkinByRule()
    #...

  def getSkinByRule(self):
    strSkinName = None
    # HERE IS THE PROBLEM
    objUser = getSecurityManager().getUser()
    # objUser is always the Anonymous User
    #...
#...

_________________________________________________________________
Choose an Internet access plan right for you -- try MSN!
http://resourcecenter.msn.com/access/plans/default.asp


_______________________________________________
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