dataflake.org

Home Documentation Software Old Stuff

Incorrect assigned roles if user doesn't exist in the ldap (Resolved)

Request LDAPMultiPlugins -- bug report -- by Riccardo Lemmi (axa)
Posted on Jun 7, 2006 4:58 am
Subscribe

Enter your email address to receive mail on every change to this issue.

Entries (Latest first)


  Resolve by Jens Vagelpohl on Jun 7, 2006 4:22 pm
  Thanks for the patch, it's in the repository now.
 

  Initial Request by Riccardo Lemmi (axa) on Jun 7, 2006 4:58 am
  Incorrect assigned roles if user doesn't exist in the ldap. We have a patch for this incorrect behavior, in LDAPPluginBase.py:
security.declarePrivate('getRolesForPrincipal')
def getRolesForPrincipal(self, user, request=None):
""" Fullfill RolesPlugin requirements """
acl = self._getLDAPUserFolder()
##
if acl is None:
return ()
unmangled_userid = self._demangle(user.getId())
if unmangled_userid is None:
return ()
ldap_user = acl.getUserById(unmangled_userid)
if ldap_user is None:
return ()
##
groups = self.getGroupsForPrincipal(user, request)
roles = list(acl._mapRoles(groups))
roles.extend(acl._roles)

return tuple(roles)