Interface AccountBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface AccountBusinessAssignmentSession extends OsidSession

This session provides methods to re-assign Accounts to Businesses . An Account may appear in multiple Businesses and removing the last reference to an Account is the equivalent of deleting it. Each Business may have its own authorizations governing who is allowed to operate on it.

Adding a reference of an Account to another Business is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignAccounts

      boolean canAssignAccounts()
      Tests if this user can alter account/business 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.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignAccountToBusiness

      boolean canAssignAccountToBusiness(Id businessId)
      Tests if this user can alter account/business 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.
      Parameters:
      businessId - the Id of the Business
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - businessId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIds

      IdList getAssignableBusinessIds(Id businessId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which any account can be assigned.
      Parameters:
      businessId - the Id of the Business
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIdsForAccount

      IdList getAssignableBusinessIdsForAccount(Id businessId, Id accountId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which a specific account can be assigned.
      Parameters:
      businessId - the Id of the Business
      accountId - the Id of the Account
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId or accountId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignAccountToBusiness

      void assignAccountToBusiness(Id accountId, Id businessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Account to a Business .
      Parameters:
      accountId - the Id of the Account
      businessId - the Id of the Business
      Throws:
      AlreadyExistsException - accountId is already assigned to businessId
      NotFoundException - accountId or businessId not found
      NullArgumentException - accountId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignAccountFromBusiness

      void unassignAccountFromBusiness(Id accountId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an Account from a Business .
      Parameters:
      accountId - the Id of the Account
      businessId - the Id of the Business
      Throws:
      NotFoundException - accountId or businessId not found or accountId not assigned to businessId
      NullArgumentException - accountId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.