mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
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
This commit is contained in:
20
src/authorization/PermissionReader.ts
Normal file
20
src/authorization/PermissionReader.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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> {}
|
||||
Reference in New Issue
Block a user