Interface Authorization
- All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject, OsidRelationship, Temporal
An Authorization is a mapping among an actor, a Function and a
Qualifier . This interface is not required for performing
authorization checks but is used for examining and managing
authorizations.
The actor of an authorization may be specified in a variety of forms.
-
Agent -
Resource: all theAgentsassociated with aResourcefor matching authorizations -
ResourceandTrust: all theAgentswithin a cicle ofTrustare used
An explicit Authorization represents the mappings as they are
directly managed in the AuthorizationAdminSession . Implicit
authorizations may be retrieved which are authorizations inferred through
the Function or Qualifier hierarchies. An implicit
Authorization is one where isImplicit() is true and should not be
used for modification as it is only available for auditing purposes.
An Authorization containing a Resource may also
provide the associated Agent in a request for implicit authorizations or
for all the authorizations, both explicit and implicit, for a given
Agent .
-
Method Summary
Modifier and TypeMethodDescriptiongetAgent()Gets theAgentfor this authorization.Gets theAgent Idfor this authorization.getAuthorizationRecord(Type authorizationRecordType) Gets the authorization record corresponding to the givenAuthorizationrecordType.Gets theFunctionfor this authorization.Gets theFunction Idfor this authorization.Gets the qualifier for this authorization.Gets theQualifier Idfor this authorization.Gets theResourcefor this authorization.Gets theresource Idfor this authorization.getTrust()Gets theTrustfor this authorization.Gets theTrustIdfor this authorization.booleanhasAgent()Tests if this authorization has anAgent.An implied authorization may have anAgentin addition to a specifiedResource.booleanTests if this authorization has aResource.booleanhasTrust()Tests if this authorization has aTrust.booleanTests if this authorization is implicit.Methods inherited from interface Browsable
getProperties, getPropertiesByRecordTypeModifier and TypeMethodDescriptionGets a list of properties.getPropertiesByRecordType(Type recordType) Gets a list of properties corresponding to the specified record type.Methods inherited from interface Extensible
getRecordTypes, hasRecordTypeModifier and TypeMethodDescriptionGets the record types available in this object.booleanhasRecordType(Type recordType) Tests if this object supports the given recordType.Methods inherited from interface Identifiable
getId, isCurrentMethods inherited from interface OsidObject
getDescription, getDisplayName, getGenusType, isOfGenusTypeModifier and TypeMethodDescriptionGets the description associated with this instance of this OSID object.Gets the preferred display name associated with this instance of this OSID object appropriate for display to the user.Gets the genus type of this object.booleanisOfGenusType(Type genusType) Tests if this object is of the given genusType.Methods inherited from interface OsidRelationship
getEndReason, getEndReasonId, hasEndReasonModifier and TypeMethodDescriptionGets a state indicating why this relationship has ended.Gets a stateIdindicating why this relationship has ended.booleanTests if a reason this relationship came to an end is known.Methods inherited from interface Temporal
getEndDate, getStartDate, isEffectiveModifier and TypeMethodDescriptionGets the end date.Gets the start date.booleanTests if the current date is within the start end end dates inclusive.
-
Method Details
-
isImplicit
boolean isImplicit()Tests if this authorization is implicit.- Returns:
trueif this authorization is implicit,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
hasResource
boolean hasResource()Tests if this authorization has aResource.- Returns:
trueif this authorization has aResource,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
getResourceId
Id getResourceId()Gets theresource Idfor this authorization.- Returns:
- the
Resource Id - Throws:
IllegalStateException-hasResource()isfalse- Compliance:
mandatory- This method must be implemented.
-
getResource
Gets theResourcefor this authorization.- Returns:
- the
Resource - Throws:
IllegalStateException-hasResource()isfalseOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
hasTrust
boolean hasTrust()Tests if this authorization has aTrust.- Returns:
trueif this authorization has aTrust,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
getTrustId
Id getTrustId()Gets theTrustIdfor this authorization.- Returns:
- the trust
Id - Throws:
IllegalStateException-hasTrust()isfalse- Compliance:
mandatory- This method must be implemented.
-
getTrust
Gets theTrustfor this authorization.- Returns:
- the
Trust - Throws:
IllegalStateException-hasTrust()isfalseOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
hasAgent
boolean hasAgent()Tests if this authorization has anAgent.An implied authorization may have anAgentin addition to a specifiedResource.- Returns:
trueif this authorization has anAgent,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
getAgentId
Id getAgentId()Gets theAgent Idfor this authorization.- Returns:
- the
Agent Id - Throws:
IllegalStateException-hasAgent()isfalse- Compliance:
mandatory- This method must be implemented.
-
getAgent
Gets theAgentfor this authorization.- Returns:
- the
Agent - Throws:
IllegalStateException-hasAgent()isfalseOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getFunctionId
Id getFunctionId()Gets theFunction Idfor this authorization.- Returns:
- the function
Id - Compliance:
mandatory- This method must be implemented.
-
getFunction
Gets theFunctionfor this authorization.- Returns:
- the function
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getQualifierId
Id getQualifierId()Gets theQualifier Idfor this authorization.- Returns:
- the qualifier
Id - Compliance:
mandatory- This method must be implemented.
-
getQualifier
Gets the qualifier for this authorization.- Returns:
- the qualifier
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationRecord
AuthorizationRecord getAuthorizationRecord(Type authorizationRecordType) throws OperationFailedException Gets the authorization record corresponding to the givenAuthorizationrecordType. This method is used to retrieve an object implementing the requested record. TheauthorizationRecordTypemay be theTypereturned ingetRecordTypes()or any of its parents in aTypehierarchy wherehasRecordType(authorizationRecordType)istrue.- Parameters:
authorizationRecordType- the type of the record to retrieve- Returns:
- the authorization record
- Throws:
NullArgumentException-authorizationRecordTypeisnullOperationFailedException- unable to complete requestUnsupportedException-hasRecordType(authorizationRecordType)isfalse- Compliance:
mandatory- This method must be implemented.
-