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

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

Assign a role to a principal (user or group).

o Return a boolean indicating whether a new assignment was created.

o Raise KeyError if 'role_id' is unknown.

Definition at line 276 of file ZODBRoleManager.py.

00276                                                             :

        """ Assign a role to a principal (user or group).

        o Return a boolean indicating whether a new assignment was created.

        o Raise KeyError if 'role_id' is unknown.
        """
        role_info = self._roles[ role_id ] # raise KeyError if unknown!

        current = self._principal_roles.get( principal_id, () )
        already = role_id in current

        if not already:
            new = current + ( role_id, )
            self._principal_roles[ principal_id ] = new

        return not already

    security.declareProtected( ManageUsers, 'removeRoleFromPrincipal' )
    def removeRoleFromPrincipal( self, role_id, principal_id ):


Generated by  Doxygen 1.6.0   Back to index