[Zope-CMF] cannot get authenticated user

Rocky Mazzeo rjmazzeo@hotmail.com
Fri, 18 Oct 2002 11:32:22 -0700


Tried it, no luck. I think I'm going to change my tactics though. Rather 
than extending SkinsTool, it seems people have been having success with 
python script and Access Rules.

http://www.zopelabs.com/cookbook/1028172355

Does anyone have an idea if I'm going to pay a larger overhead this way?





----Original Message Follows----
From: "Kevin Carlson" <khcarlso@bellsouth.net>
To: "Rocky Mazzeo" <rjmazzeo@hotmail.com>,<zope-cmf@zope.org>
Subject: RE: [Zope-CMF] cannot get authenticated user
Date: 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


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963