Interface OrganizationRealmAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface OrganizationRealmAssignmentSession extends OsidSession

This session provides methods to re-assign Organizations to Bilings . An Organization may map to multiple Realms and removing the last reference to an Organization 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 an Organization to another Realm is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignOrganizations

      boolean canAssignOrganizations()
      Tests if this user can alter organization/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.
    • canAssignOrganizationsToRealm

      boolean canAssignOrganizationsToRealm(Id realmId)
      Tests if this user can alter organization/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 organization 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.
    • getAssignableRealmIdsForOrganization

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

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

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

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