Logo Search packages:      
Sourcecode: zope-ldapmultiplugins version File versions  Download package

def LDAPMultiPlugins::LDAPPluginBase::LDAPPluginBase::getRolesForPrincipal (   self,
  user,
  request = None 
)

Fullfill RolesPlugin requirements 

Definition at line 121 of file LDAPPluginBase.py.

00121                                                       :
        """ 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)


    security.declarePrivate('_demangle')
    def _demangle(self, princid):


Generated by  Doxygen 1.6.0   Back to index