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

def PluggableAuthService-1.4::plugins::ZODBRoleManager::ZODBRoleManager::removeRoleFromPrincipal (   self,
  role_id,
  principal_id 
)

Remove a role from a principal (user or group).

o Return a boolean indicating whether the role was already present.

o Raise KeyError if 'role_id' is unknown.

o Ignore requests to remove a role not already assigned to the
  principal.

Definition at line 296 of file ZODBRoleManager.py.

00296                                                               :

        """ Remove a role from a principal (user or group).

        o Return a boolean indicating whether the role was already present.

        o Raise KeyError if 'role_id' is unknown.

        o Ignore requests to remove a role not already assigned to the
          principal.
        """
        role_info = self._roles[ role_id ] # raise KeyError if unknown!

        current = self._principal_roles.get( principal_id, () )
        new = tuple( [ x for x in current if x != role_id ] )
        already = current != new

        if already:
            self._principal_roles[ principal_id ] = new

        return already

    #
    #   ZMI


Generated by  Doxygen 1.6.0   Back to index