Interface ProfileItemProfileAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ProfileItemProfileAssignmentSession extends OsidSession

This session provides methods to re-assign ProfileItems to Profiles . A ProfileItem may map to multiple Profiles and removing the last reference to a ProfileItem is the equivalent of deleting it. Each Profile may have its own authorizations governing who is allowed to operate on it.

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

  • Method Details

    • canAssignProfileItems

      boolean canAssignProfileItems()
      Tests if this user can alter profile/item 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.
    • canAssignProfileItemsToProfile

      boolean canAssignProfileItemsToProfile(Id profileId)
      Tests if this user can alter profile/item 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:
      profileId - the Id of the Profile
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - profileId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableProfileIds

      IdList getAssignableProfileIds(Id profileId) throws OperationFailedException
      Gets a list of profile including and under the given profile node in which any profile item can be assigned.
      Parameters:
      profileId - the Id of the Profile
      Returns:
      list of assignable profile Ids
      Throws:
      NullArgumentException - profileId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableProfileIdsForProfileItem

      IdList getAssignableProfileIdsForProfileItem(Id profileId, Id profileItemId) throws OperationFailedException
      Gets a list of profile including and under the given profile node in which a specific profile item can be assigned.
      Parameters:
      profileId - the Id of the Profile
      profileItemId - the Id of the ProfileItem
      Returns:
      list of assignable profile Ids
      Throws:
      NullArgumentException - profileId or profileItemId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignProfileItemToProfile

      void assignProfileItemToProfile(Id profileItemId, Id profileId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing ProfileItem to a Profile .
      Parameters:
      profileItemId - the Id of the ProfileItem
      profileId - the Id of the Profile
      Throws:
      AlreadyExistsException - profileItemId is already assigned to profileId
      NotFoundException - profileItemId or profileId not found
      NullArgumentException - profileItemId or profileId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignProfileItemFromProfile

      void unassignProfileItemFromProfile(Id profileItemId, Id profileId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a ProfileItem from a Profile .
      Parameters:
      profileItemId - the Id of the ProfileItem
      profileId - the Id of the Profile
      Throws:
      NotFoundException - profileItemId or profileId not found or profileItemId not assigned to profileId
      NullArgumentException - profileItemId or profileId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignProfileItemToProfile

      void reassignProfileItemToProfile(Id profileItemId, Id fromProfileId, Id toProfileId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a ProfileItem from one Profile to another. Mappings to other Profiles are unaffected.
      Parameters:
      profileItemId - the Id of the ProfileItem
      fromProfileId - the Id of the current Profile
      toProfileId - the Id of the destination Profile
      Throws:
      AlreadyExistsException - profileItemId already assigned to toProfileId
      NotFoundException - profileItemId, fromProfileId , or toProfileId not found or profileItemId not mapped to fromProfileId
      NullArgumentException - profileItemId, fromProfileId , or toProfileId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.