Interface PersonRealmAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PersonRealmAssignmentSession extends OsidSession

This session provides methods to re-assign Persons to Bilings . A Person may map to multiple Realms and removing the last reference to a Person is the equivalent of deleting it. Each Realm may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Person to another Realm is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignPersons

      boolean canAssignPersons()
      Tests if this user can alter person/realm mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignPersonsToRealm

      boolean canAssignPersonsToRealm(Id realmId)
      Tests if this user can alter person/realm mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      realmId - the Id of the Realm
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - realmId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableRealmIds

      IdList getAssignableRealmIds(Id realmId) throws OperationFailedException
      Gets a list of realms including and under the given realm node in which any person can be assigned.
      Parameters:
      realmId - the Id of the Realm
      Returns:
      list of assignable realm Ids
      Throws:
      NullArgumentException - realmId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableRealmIdsForPerson

      IdList getAssignableRealmIdsForPerson(Id realmId, Id personId) throws OperationFailedException
      Gets a list of realms including and under the given realm node in which a specific person can be assigned.
      Parameters:
      realmId - the Id of the Realm
      personId - the Id of the Person
      Returns:
      list of assignable realm Ids
      Throws:
      NullArgumentException - realmId or personId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignPersonToRealm

      void assignPersonToRealm(Id personId, Id realmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Person to a Realm .
      Parameters:
      personId - the Id of the Person
      realmId - the Id of the Realm
      Throws:
      AlreadyExistsException - personId already assigned to realmId
      NotFoundException - personId or realmId not found
      NullArgumentException - personId or realmId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignPersonFromRealm

      void unassignPersonFromRealm(Id personId, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Person from a Realm .
      Parameters:
      personId - the Id of the Person
      realmId - the Id of the Realm
      Throws:
      NotFoundException - personId or realmId not found or personId not mapped to realmId
      NullArgumentException - personId or realmId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignPersonToRealm

      void reassignPersonToRealm(Id personId, Id fromRealmId, Id toRealmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Person from one Realm to another. Mappings to other Realms are unaffected.
      Parameters:
      personId - the Id of the Person
      fromRealmId - the Id of the current Realm
      toRealmId - the Id of the destination Realm
      Throws:
      AlreadyExistsException - personId already assigned to toRealmId
      NotFoundException - personId, fromRealmId , or toRealmId not found or personId not mapped to fromRealmId
      NullArgumentException - personId, fromRealmId , or toRealmId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.