OSID Logo
OSID Specifications
authorization package
Version 3.0.0
Release Candidate Preview
Interfaceosid.authorization.FunctionAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Functions. The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Function, a FunctionForm is requested using getFunctionFormForCreate() specifying the desired relationship peers and record Types or none if no record Types are needed. The returned FunctionForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the FunctionForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each FunctionForm corresponds to an attempted transaction.

For updates, FunctionForms are requested to the Function Id that is to be updated using getFunctionFormForUpdate(). Similarly, the FunctionForm has metadata about the data that can be updated and it can perform validation before submitting the update. The FunctionForm can only be used once for a successful update and cannot be reused.

The delete operations delete Functions. To unmap a Function from the current Vault, the FunctionVaultAssignmentSession should be used. These delete operations attempt to remove the Function itself thus removing it from all known Vault catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetVaultId
Description

Gets the Vault Id associated with this session.

Returnosid.id.Idthe Vault Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetVault
Description

Gets the Vault associated with this session.

Returnosid.authorization.Vaultthe vault
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateFunctions
Description

Tests if this user can create Functions. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Function will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Function creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateFunctionWithRecordTypes
Description

Tests if this user can create a single Function using the desired record types. While AuthorizationManager.getFunctionRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Function. Providing an empty array tests if a Function can be created with no records.

Parametersosid.type.Type[]functionRecordTypesarray of function record types
Returnboolean true if Function creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT functionRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetFunctionFormForCreate
Description

Gets the function form for creating new functions. A new form should be requested for each create transaction.

Parametersosid.type.Type[]functionRecordTypesarray of function record types
Returnosid.authorization.FunctionFormthe function form
ErrorsNULL_ARGUMENT functionRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form qith requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateFunction
Description

Creates a new Function.

Parametersosid.authorization.FunctionFormfunctionFormthe form for this Function
Returnosid.authorization.Functionthe new Function
ErrorsILLEGAL_STATE functionForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT functionForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED functionForm did not originate from getFunctionFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateFunctions
Description

Tests if this user can update Functions. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Function will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if function modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetFunctionFormForUpdate
Description

Gets the function form for updating an existing function. A new function form should be requested for each update transaction.

Parametersosid.id.IdfunctionIdthe Id of the Function
Returnosid.authorization.FunctionFormthe function form
ErrorsNOT_FOUND functionId is not found
NULL_ARGUMENT functionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateFunction
Description

Updates an existing function.

Parametersosid.authorization.FunctionFormfunctionFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE functionForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT functionForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED functionForm did not originate from getFunctionFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteFunctions
Description

Tests if this user can delete Functions. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Function will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Function deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteFunction
Description

Deletes the Function identified by the given Id.

Parametersosid.id.IdfunctionIdthe Id of the Function to delete
ErrorsNOT_FOUNDa Function was not found identified by the given Id
NULL_ARGUMENT functionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageFunctionAliases
Description

Tests if this user can manage Id aliases for Functions. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if Function aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasFunction
Description

Adds an Id to a Function for the purpose of creating compatibility. The primary Id of the Function is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another function, it is reassigned to the given function Id.

Parametersosid.id.IdfunctionIdthe Id of a Function
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND functionId not found
NULL_ARGUMENT functionId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.