Interface PostBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PostBusinessAssignmentSession extends OsidSession

This session provides methods to re-assign Posts to Businesses . A Post may appear in multiple Businesses and removing the last reference to a Post 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 a Post to another Business is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignPosts

      boolean canAssignPosts()
      Tests if this user can alter post/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.
    • canAssignPostToBusiness

      boolean canAssignPostToBusiness(Id businessId)
      Tests if this user can alter post/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 post 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.
    • getAssignableBusinessIdsForPost

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

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

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

      void reassignPostToBusiness(Id postId, Id fromBusinessId, Id toBusinessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Post from one Business to another. Mappings to other Businesses are unaffected.
      Parameters:
      postId - the Id of the Post
      fromBusinessId - the Id of the current Business
      toBusinessId - the Id of the destination Business
      Throws:
      AlreadyExistsException - postId is already assigned to toBusinessId
      NotFoundException - postId, fromBusinessId , or toBusinessId not found or postId not mapped to fromBusinessId
      NullArgumentException - postId, fromBusinessId , or toBusinessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.