Interface Authorization

All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject, OsidRelationship, Temporal

public interface Authorization extends OsidRelationship

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 the Agents associated with a Resource for matching authorizations
  • Resource and Trust : all the Agents within a cicle of Trust are 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 Details

    • isImplicit

      boolean isImplicit()
      Tests if this authorization is implicit.
      Returns:
      true if this authorization is implicit, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • hasResource

      boolean hasResource()
      Tests if this authorization has a Resource .
      Returns:
      true if this authorization has a Resource , false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getResourceId

      Id getResourceId()
      Gets the resource Id for this authorization.
      Returns:
      the Resource Id
      Throws:
      IllegalStateException - hasResource() is false
      Compliance:
      mandatory - This method must be implemented.
    • getResource

      Resource getResource() throws OperationFailedException
      Gets the Resource for this authorization.
      Returns:
      the Resource
      Throws:
      IllegalStateException - hasResource() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • hasTrust

      boolean hasTrust()
      Tests if this authorization has a Trust .
      Returns:
      true if this authorization has a Trust , false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getTrustId

      Id getTrustId()
      Gets the Trust Id for this authorization.
      Returns:
      the trust Id
      Throws:
      IllegalStateException - hasTrust() is false
      Compliance:
      mandatory - This method must be implemented.
    • getTrust

      Trust getTrust() throws OperationFailedException
      Gets the Trust for this authorization.
      Returns:
      the Trust
      Throws:
      IllegalStateException - hasTrust() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • hasAgent

      boolean hasAgent()
      Tests if this authorization has an Agent .An implied authorization may have an Agent in addition to a specified Resource .
      Returns:
      true if this authorization has an Agent , false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getAgentId

      Id getAgentId()
      Gets the Agent Id for this authorization.
      Returns:
      the Agent Id
      Throws:
      IllegalStateException - hasAgent() is false
      Compliance:
      mandatory - This method must be implemented.
    • getAgent

      Agent getAgent() throws OperationFailedException
      Gets the Agent for this authorization.
      Returns:
      the Agent
      Throws:
      IllegalStateException - hasAgent() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getFunctionId

      Id getFunctionId()
      Gets the Function Id for this authorization.
      Returns:
      the function Id
      Compliance:
      mandatory - This method must be implemented.
    • getFunction

      Function getFunction() throws OperationFailedException
      Gets the Function for this authorization.
      Returns:
      the function
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getQualifierId

      Id getQualifierId()
      Gets the Qualifier Id for this authorization.
      Returns:
      the qualifier Id
      Compliance:
      mandatory - This method must be implemented.
    • getQualifier

      Qualifier getQualifier() throws OperationFailedException
      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 given Authorization record Type . This method is used to retrieve an object implementing the requested record. The authorizationRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(authorizationRecordType) is true .
      Parameters:
      authorizationRecordType - the type of the record to retrieve
      Returns:
      the authorization record
      Throws:
      NullArgumentException - authorizationRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(authorizationRecordType) is false
      Compliance:
      mandatory - This method must be implemented.