Interface PersonRealmAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Persons to
Bilings . A Person may map to multiple Realms and
removing the last reference to a Person 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 a Person to another Realm is not
a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignPersonToRealm(Id personId, Id realmId) Adds an existingPersonto aRealm.booleanTests if this user can alter person/realm mappings.booleancanAssignPersonsToRealm(Id realmId) Tests if this user can alter person/realm mappings.getAssignableRealmIds(Id realmId) Gets a list of realms including and under the given realm node in which any person can be assigned.getAssignableRealmIdsForPerson(Id realmId, Id personId) Gets a list of realms including and under the given realm node in which a specific person can be assigned.voidreassignPersonToRealm(Id personId, Id fromRealmId, Id toRealmId) Moves aPersonfrom oneRealmto another.voidunassignPersonFromRealm(Id personId, Id realmId) Removes aPersonfrom aRealm.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
-
canAssignPersons
boolean canAssignPersons()Tests if this user can alter person/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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignPersonsToRealm
Tests if this user can alter person/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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
realmId- theIdof theRealm- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-realmIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableRealmIds
Gets a list of realms including and under the given realm node in which any person can be assigned.- Parameters:
realmId- theIdof theRealm- Returns:
- list of assignable realm
Ids - Throws:
NullArgumentException-realmIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableRealmIdsForPerson
Gets a list of realms including and under the given realm node in which a specific person can be assigned.- Parameters:
realmId- theIdof theRealmpersonId- theIdof thePerson- Returns:
- list of assignable realm
Ids - Throws:
NullArgumentException-realmIdorpersonIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignPersonToRealm
void assignPersonToRealm(Id personId, Id realmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingPersonto aRealm.- Parameters:
personId- theIdof thePersonrealmId- theIdof theRealm- Throws:
AlreadyExistsException-personIdalready assigned torealmIdNotFoundException-personIdorrealmIdnot foundNullArgumentException-personIdorrealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignPersonFromRealm
void unassignPersonFromRealm(Id personId, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aPersonfrom aRealm.- Parameters:
personId- theIdof thePersonrealmId- theIdof theRealm- Throws:
NotFoundException-personIdorrealmIdnot found orpersonIdnot mapped torealmIdNullArgumentException-personIdorrealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignPersonToRealm
void reassignPersonToRealm(Id personId, Id fromRealmId, Id toRealmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aPersonfrom oneRealmto another. Mappings to otherRealmsare unaffected.- Parameters:
personId- theIdof thePersonfromRealmId- theIdof the currentRealmtoRealmId- theIdof the destinationRealm- Throws:
AlreadyExistsException-personIdalready assigned totoRealmIdNotFoundException-personId, fromRealmId, ortoRealmIdnot found orpersonIdnot mapped tofromRealmIdNullArgumentException-personId, fromRealmId, ortoRealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-