why is that code no longer referring to the real userfolder anymore? it should not make calls to authorize/identify/authorize on "self" but on the LDAPUserFolder it is using as the user source.


On Thursday, Oct 17, 2002, at 03:39 US/Eastern, Dirk Datzert wrote:

Hi all,

I try to solve some problems with LDAPRoleTwiddler an inherited version from BasicUserFolder

I currently use a validate()-function which I saw similar in BasicUserFolder and in LDAPRoleExtender (modifications from Shane)

My problem is that
if self.authorize(user, a, c, n, v, roles):
return user.__of__(self)
in validate() does not work, but
return user.__of__(self)
work better, but does not the same as the API (which I don't know) expect.

Can anybody give a hint ?


used python code:

# This must stay accessible to everyone
def validate( self, request, auth='', roles=_noroles ):
""" The main engine """

v = request['PUBLISHED'] # the published object
a, c, n, v = self._getobcontext(v, request)

name, password = self.identify(auth)
user = self.authenticate(name, password, request)

if user is not None:
if user is not None:
# On my Test-System it works with authorize()
# On my Integration-System it works only without authorize()
#if self.authorize(user, a, c, n, v, roles):
return user.__of__(self)

# Could not twiddle a user. Defer to other user folders.
return None

def authenticate(self, name, password, request):
super = self._emergency_user

if name is None:
return None

if super and name == super.getUserName():
user = super
user = self.getUser(name, password)

if user is not None and user.authenticate(password, request):
return user
return None

<Dirk Datzert.vcf>

Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )

Reply via email to