Objects

Authorization

class dlkit.authorization.objects.Authorization

Bases: dlkit.osid.objects.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: the authorization provider uses all the Agents associated with a Resource for matching authorizations
  • Resource and Trust: the authorization provider uses the associated Agents within a cicle of Trust

An explicit Authorization represents the mappings as they are specified in the authorization provdier. Implicit authorizations may be retrieved which are authorizations inferred through the Function or Qualifier hierarchies. An implicit Authorization is one where is_implicit() 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.

is_implicit()

Tests if this authorization is implicit.

Returns:true if this authorization is implicit, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

has_resource()

Tests if this authorization has a Resource.

Returns:true if this authorization has a Resource, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

resource_id

Gets the resource _id for this authorization.

Returns:the Resource Id
Return type:osid.id.Id
Raise:IllegalStatehas_resource() is false

compliance: mandatory – This method must be implemented.

resource

Gets the Resource for this authorization.

Returns:the Resource
Return type:osid.resource.Resource
Raise:IllegalStatehas_resource() is false
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

has_trust()

Tests if this authorization has a Trust.

Returns:true if this authorization has a Trust, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

trust_id

Gets the Trust Id for this authorization.

Returns:the trust Id
Return type:osid.id.Id
Raise:IllegalStatehas_trust() is false

compliance: mandatory – This method must be implemented.

trust

Gets the Trust for this authorization.

Returns:the Trust
Return type:osid.authentication.process.Trust
Raise:IllegalStatehas_trust() is false
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

has_agent()

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
Return type:boolean

compliance: mandatory – This method must be implemented.

agent_id

Gets the Agent Id for this authorization.

Returns:the Agent Id
Return type:osid.id.Id
Raise:IllegalStatehas_agent() is false

compliance: mandatory – This method must be implemented.

agent

Gets the Agent for this authorization.

Returns:the Agent
Return type:osid.authentication.Agent
Raise:IllegalStatehas_agent() is false
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

function_id

Gets the Function Id for this authorization.

Returns:the function Id
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

function

Gets the Function for this authorization.

Returns:the function
Return type:osid.authorization.Function
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

qualifier_id

Gets the Qualifier Id for this authorization.

Returns:the qualifier Id
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

qualifier

Gets the qualifier for this authorization.

Returns:the qualifier
Return type:osid.authorization.Qualifier
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_authorization_record(authorization_record_type)

Gets the authorization record corresponding to the given Authorization record Type.

This method is used to retrieve an object implementing the requested record. The authorization_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(authorization_record_type) is true .

Parameters:authorization_record_type (osid.type.Type) – the type of the record to retrieve
Returns:the authorization record
Return type:osid.authorization.records.AuthorizationRecord
Raise:NullArgumentauthorization_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(authorization_record_type) is false

compliance: mandatory – This method must be implemented.

Authorization Form

class dlkit.authorization.objects.AuthorizationForm

Bases: dlkit.osid.objects.OsidRelationshipForm

This is the form for creating and updating Authorizations.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the AuthorizationAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

get_authorization_form_record(authorization_record_type)

Gets the AuthorizationFormRecord corresponding to the given authorization record Type.

Parameters:authorization_record_type (osid.type.Type) – the authorization record type
Returns:the authorization form record
Return type:osid.authorization.records.AuthorizationFormRecord
Raise:NullArgumentauthorization_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(authorization_record_type) is false

compliance: mandatory – This method must be implemented.

Authorization List

class dlkit.authorization.objects.AuthorizationList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, AuthorizationList provides a means for accessing Authorization elements sequentially either one at a time or many at a time.

Examples: while (al.hasNext()) { Authorization authorization = al.getNextAuthorization(); }

or
while (al.hasNext()) {
Authorization[] authorizations = al.getNextAuthorizations(al.available());

}

next_authorization

Gets the next Authorization in this list.

Returns:the next Authorization in this list. The has_next() method should be used to test that a next Authorization is available before calling this method.
Return type:osid.authorization.Authorization
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_next_authorizations(n)

Gets the next set of Authorization elements in this list which must be less than or equal to the number returned from available().

Parameters:n (cardinal) – the number of Authorization elements requested which should be less than or equal to available()
Returns:an array of Authorization elements.The length of the array is less than or equal to the number specified.
Return type:osid.authorization.Authorization
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

Vault

class dlkit.authorization.objects.Vault(abc_authorization_objects.Vault, osid_objects.OsidCatalog)
:noindex:
get_vault_record(vault_record_type)

Gets the vault record corresponding to the given Vault record Type.

This method is used to retrieve an object implementing the requested record. The vault_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(vault_record_type) is true .

Parameters:vault_record_type (osid.type.Type) – a vault record type
Returns:the vault record
Return type:osid.authorization.records.VaultRecord
Raise:NullArgumentvault_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(vault_record_type) is false

compliance: mandatory – This method must be implemented.

Vault Form

class dlkit.authorization.objects.VaultForm

Bases: dlkit.osid.objects.OsidCatalogForm

This is the form for creating and updating vaults.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the VaultAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

get_vault_form_record(vault_record_type)

Gets the VaultFormRecord corresponding to the given vault record Type.

Parameters:vault_record_type (osid.type.Type) – a vault record type
Returns:the vault form record
Return type:osid.authorization.records.VaultFormRecord
Raise:NullArgumentvault_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(vault_record_type) is false

compliance: mandatory – This method must be implemented.

Vault List

class dlkit.authorization.objects.VaultList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, VaultList provides a means for accessing Vault elements sequentially either one at a time or many at a time.

Examples: while (vl.hasNext()) { Vault vault = vl.getNextVault(); }

or
while (vl.hasNext()) {
Vault[] vaults = vl.getNextVaults(vl.available());

}

next_vault

Gets the next Vault in this list.

Returns:the next Vault in this list. The has_next() method should be used to test that a next Vault is available before calling this method.
Return type:osid.authorization.Vault
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_next_vaults(n)

Gets the next set of Vault elements in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of Vault elements requested which must be less than or equal to available()
Returns:an array of Vault elements.The length of the array is less than or equal to the number specified.
Return type:osid.authorization.Vault
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

Vault Node

class dlkit.authorization.objects.VaultNode

Bases: dlkit.osid.objects.OsidNode

This interface is a container for a partial hierarchy retrieval.

The number of hierarchy levels traversable through this interface depend on the number of levels requested in the VaultHierarchySession.

vault

Gets the Vault at this node.

Returns:the vault represented by this node
Return type:osid.authorization.Vault

compliance: mandatory – This method must be implemented.

parent_vault_nodes

Gets the parents of this vault.

Returns:the parents of this vault
Return type:osid.authorization.VaultNodeList

compliance: mandatory – This method must be implemented.

child_vault_nodes

Gets the children of this vault.

Returns:the children of this vault
Return type:osid.authorization.VaultNodeList

compliance: mandatory – This method must be implemented.

Vault Node List

class dlkit.authorization.objects.VaultNodeList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, VaultNodeList provides a means for accessing VaultNode elements sequentially either one at a time or many at a time.

Examples: while (vnl.hasNext()) { VaultNode node = vnl.getNextVaultNode(); }

or
while (vnl.hasNext()) {
VaultNode[] nodes = vnl.getNextVaultNodes(vnl.available());

}

next_vault_node

Gets the next VaultNode in this list.

Returns:the next VaultNode in this list. The has_next() method should be used to test that a next VaultNode is available before calling this method.
Return type:osid.authorization.VaultNode
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_next_vault_nodes(n)

Gets the next set of VaultNode elements in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of VaultNode elements requested which must be less than or equal to available()
Returns:an array of VaultNode elements.The length of the array is less than or equal to the number specified.
Return type:osid.authorization.VaultNode
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.