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

def PluggableAuthService-1.4::plugins::ZODBRoleManager::ZODBRoleManager::listAvailablePrincipals (   self,
  role_id,
  search_id 
)

Return a list of principal IDs to whom a role can be assigned.

o If supplied, 'search_id' constrains the principal IDs;  if not,
  return empty list.

o Omit principals with existing assignments.

Definition at line 225 of file ZODBRoleManager.py.

00225                                                            :

        """ Return a list of principal IDs to whom a role can be assigned.

        o If supplied, 'search_id' constrains the principal IDs;  if not,
          return empty list.

        o Omit principals with existing assignments.
        """
        result = []

        if search_id:  # don't bother searching if no criteria

            parent = aq_parent( self )

            for info in parent.searchPrincipals( max_results=20
                                               , sort_by='id'
                                               , id=search_id
                                               , exact_match=False
                                               ):
                id = info[ 'id' ]
                title = info.get( 'title', id )
                if ( role_id not in self._principal_roles.get( id, () )
                 and role_id != id ):
                    result.append( ( id, title ) )

        return result

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


Generated by  Doxygen 1.6.0   Back to index