OSID Logo
OSID Specifications
course program package
Version 3.0.0
Release Candidate Preview
Interfaceosid.course.program.CredentialAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Credentials. 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 Credential, a CredentialForm is requested using getCredentialFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned CredentialForm 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 CredentialForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each CredentialForm corresponds to an attempted transaction.

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

The delete operations delete CredentialForms. To unmap a CredentialForm from the current CourseCatalog, the CredentialFormCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the CredentialForm itself thus removing it from all known CourseCatalog catalogs.

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

MethodgetCourseCatalogId
Description

Gets the CourseCatalog Id associated with this session.

Returnosid.id.Idthe CourseCatalog Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetCourseCatalog
Description

Gets the CourseCatalog associated with this session.

Returnosid.course.CourseCatalogthe course catalog
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateCredentials
Description

Tests if this user can create Credentials. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a credential 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 Credential creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateCredentialWithRecordTypes
Description

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

Parametersosid.type.Type[]credentialRecordTypesarray of credential record types
Returnboolean true if Credential creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT credentialRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCredentialFormForCreate
Description

Gets the credential form for creating new credentials. A new form should be requested for each create transaction.

Parametersosid.type.Type[]credentialRecordTypesarray of credential record types
Returnosid.course.program.CredentialFormthe credential form
ErrorsNULL_ARGUMENT credentialRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateCredential
Description

Creates a new Credential.

Parametersosid.course.program.CredentialFormcredentialFormthe form for this Credential
Returnosid.course.program.Credentialthe new Credential
ErrorsILLEGAL_STATE credentialForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT credentialForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED credentialForm did not originate from getCredentialFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateCredentials
Description

Tests if this user can update Credentials. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a credential 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 credential modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetCredentialFormForUpdate
Description

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

Parametersosid.id.IdcredentialIdthe Id of the credential
Returnosid.course.program.CredentialFormthe credential form
ErrorsNOT_FOUND credentialId is not found
NULL_ARGUMENT credentialId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCredential
Description

Updates an existing credential.

Parametersosid.course.program.CredentialFormcredentialFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE credentialForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT credentialForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED credentialForm did not originate from getCredentialFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteCredentials
Description

Tests if this user can delete Credentials. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Credential 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 credential deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteCredential
Description

Deletes a Credential.

Parametersosid.id.IdcredentialIdthe Id of the Credential to remove
ErrorsNOT_FOUND credentialId not found
NULL_ARGUMENT credentialId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageCredentialAliases
Description

Tests if this user can manage Id aliases for Credentials. 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 credential aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasCredential
Description

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

Parametersosid.id.IdcredentialIdthe Id of a credential
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND credentialId not found
NULL_ARGUMENT credentialId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.