NamesRoles
in package
LTI Advantage Names and Roles Provisioning Service, version 2.
The launch claim points here only when the deployment allows contextmembership.readonly. A call still checks that deployment again: the token's scope list is not enough on its own.
TODO: Support NRPS differences and paging (https://github.com/tsugiproject/tsugi/issues/289). limit and offset only slice the full roster after it is loaded.
Table of Contents
Constants
- LIMIT_MAX : mixed = 500
- ROLE_ADMINISTRATOR : mixed = 'http://purl.imsglobal.org/vocab/lis/v2/members...
- ROLE_INSTRUCTOR : mixed = 'http://purl.imsglobal.org/vocab/lis/v2/members...
- ROLE_LEARNER : mixed = 'http://purl.imsglobal.org/vocab/lis/v2/members...
Methods
- contextIdFromPath() : mixed
- Context id from a request path, or null when this is not the membership URL.
- membershipUrl() : mixed
- Absolute membership URL placed in the launch claim.
-
read()
: array{status: int, body: array
, next: ?string} - contextRow() : array{context_id: string, key_id: int, title: string, label: string}|null
- db() : PDOX
- effectiveRole() : mixed
-
error()
: array{status: int, body: array
, next: ?string} - limit() : int|null|false
- members() : array<int, array<string, mixed>>
- nextUrl() : mixed
- offset() : int|false
- prefix() : mixed
- roleUris() : array<int, string>
- sharedClaims() : array<int, string>
Constants
LIMIT_MAX
public
mixed
LIMIT_MAX
= 500
ROLE_ADMINISTRATOR
public
mixed
ROLE_ADMINISTRATOR
= 'http://purl.imsglobal.org/vocab/lis/v2/membership#Administrator'
ROLE_INSTRUCTOR
public
mixed
ROLE_INSTRUCTOR
= 'http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor'
ROLE_LEARNER
public
mixed
ROLE_LEARNER
= 'http://purl.imsglobal.org/vocab/lis/v2/membership#Learner'
Methods
contextIdFromPath()
Context id from a request path, or null when this is not the membership URL.
public
static contextIdFromPath(string $path) : mixed
Parameters
- $path : string
membershipUrl()
Absolute membership URL placed in the launch claim.
public
static membershipUrl(int $contextId) : mixed
Parameters
- $contextId : int
read()
public
static read(string $accessToken, int $contextId, array<string, mixed> $query) : array{status: int, body: array, next: ?string}
Parameters
- $accessToken : string
- $contextId : int
- $query : array<string, mixed>
Return values
array{status: int, body: arraycontextRow()
private
static contextRow(int $contextId, int $keyId) : array{context_id: string, key_id: int, title: string, label: string}|null
Parameters
- $contextId : int
- $keyId : int
Return values
array{context_id: string, key_id: int, title: string, label: string}|nulldb()
private
static db() : PDOX
Return values
PDOXeffectiveRole()
private
static effectiveRole(array<string, mixed> $row) : mixed
Parameters
- $row : array<string, mixed>
error()
private
static error(int $status, string $error) : array{status: int, body: array, next: ?string}
Parameters
- $status : int
- $error : string
Return values
array{status: int, body: arraylimit()
private
static limit(array<string, mixed> $query) : int|null|false
Parameters
- $query : array<string, mixed>
Return values
int|null|false —null means return every member
members()
private
static members(int $contextId, int $keyId, array<int, string> $claims, string $roleFilter) : array<int, array<string, mixed>>
Parameters
- $contextId : int
- $keyId : int
- $claims : array<int, string>
- $roleFilter : string
Return values
array<int, array<string, mixed>>nextUrl()
private
static nextUrl(string $membershipUrl, int $limit, int $offset, string $roleFilter) : mixed
Parameters
- $membershipUrl : string
- $limit : int
- $offset : int
- $roleFilter : string
offset()
private
static offset(array<string, mixed> $query, int|null $limit) : int|false
Parameters
- $query : array<string, mixed>
- $limit : int|null
Return values
int|falseprefix()
private
static prefix() : mixed
roleUris()
private
static roleUris(int $role) : array<int, string>
Parameters
- $role : int
Return values
array<int, string>sharedClaims()
private
static sharedClaims(array<int, int> $deploymentIds) : array<int, string>
Parameters
- $deploymentIds : array<int, int>