CommunitySolidServer/src/authorization/PermissionReader.ts
Joachim Van Herwegen bf28c83ffa feat: Use PermissionReaders to determine available permissions
These readers will determine which permissions
are available for the incoming credentials.
Their results then get combined in a UnionReader
and authorized in a PermissionBasedAuthorizer
2021-09-28 13:06:38 +02:00

21 lines
727 B
TypeScript

import type { CredentialSet } from '../authentication/Credentials';
import type { PermissionSet } from '../ldp/permissions/Permissions';
import type { ResourceIdentifier } from '../ldp/representation/ResourceIdentifier';
import { AsyncHandler } from '../util/handlers/AsyncHandler';
export interface PermissionReaderInput {
/**
* Credentials of the entity that wants to use the resource.
*/
credentials: CredentialSet;
/**
* Identifier of the resource that will be read/modified.
*/
identifier: ResourceIdentifier;
}
/**
* Discovers the permissions of the given credentials on the given identifier.
*/
export abstract class PermissionReader extends AsyncHandler<PermissionReaderInput, PermissionSet> {}