Interface ProfileItemProfileAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidassignProfileItemToProfile(Id profileItemId, Id profileId) Adds an existingProfileItemto aProfile.booleanTests if this user can alter profile/item mappings.booleancanAssignProfileItemsToProfile(Id profileId) Tests if this user can alter profile/item mappings.getAssignableProfileIds(Id profileId) Gets a list of profile including and under the given profile node in which any profile item can be assigned.getAssignableProfileIdsForProfileItem(Id profileId, Id profileItemId) Gets a list of profile including and under the given profile node in which a specific profile item can be assigned.voidreassignProfileItemToProfile(Id profileItemId, Id fromProfileId, Id toProfileId) Moves aProfileItemfrom oneProfileto another.voidunassignProfileItemFromProfile(Id profileItemId, Id profileId) Removes aProfileItemfrom aProfile.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignProfileItemsToProfile
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
profileId- theIdof theProfile- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-profileIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableProfileIds
Gets a list of profile including and under the given profile node in which any profile item can be assigned.- Parameters:
profileId- theIdof theProfile- Returns:
- list of assignable profile
Ids - Throws:
NullArgumentException-profileIdisnullOperationFailedException- 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- theIdof theProfileprofileItemId- theIdof theProfileItem- Returns:
- list of assignable profile
Ids - Throws:
NullArgumentException-profileIdorprofileItemIdisnullOperationFailedException- 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 existingProfileItemto aProfile.- Parameters:
profileItemId- theIdof theProfileItemprofileId- theIdof theProfile- Throws:
AlreadyExistsException-profileItemIdis already assigned toprofileIdNotFoundException-profileItemIdorprofileIdnot foundNullArgumentException-profileItemIdorprofileIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignProfileItemFromProfile
void unassignProfileItemFromProfile(Id profileItemId, Id profileId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aProfileItemfrom aProfile.- Parameters:
profileItemId- theIdof theProfileItemprofileId- theIdof theProfile- Throws:
NotFoundException-profileItemIdorprofileIdnot found orprofileItemIdnot assigned toprofileIdNullArgumentException-profileItemIdorprofileIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignProfileItemToProfile
void reassignProfileItemToProfile(Id profileItemId, Id fromProfileId, Id toProfileId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aProfileItemfrom oneProfileto another. Mappings to otherProfilesare unaffected.- Parameters:
profileItemId- theIdof theProfileItemfromProfileId- theIdof the currentProfiletoProfileId- theIdof the destinationProfile- Throws:
AlreadyExistsException-profileItemIdalready assigned totoProfileIdNotFoundException-profileItemId, fromProfileId, ortoProfileIdnot found orprofileItemIdnot mapped tofromProfileIdNullArgumentException-profileItemId, fromProfileId, ortoProfileIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-