mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Add control permission to PermissionSet
This is in preparation of generalizing permissions of auxiliary resources.
This commit is contained in:
@@ -23,6 +23,7 @@ export class MethodPermissionsExtractor extends PermissionsExtractor {
|
||||
const read = READ_METHODS.has(method);
|
||||
const write = WRITE_METHODS.has(method);
|
||||
const append = write || APPEND_METHODS.has(method);
|
||||
return { read, write, append };
|
||||
const control = false;
|
||||
return { read, write, append, control };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
* A data interface indicating which permissions are allowed (based on the context).
|
||||
* A data interface indicating which permissions are required (based on the context).
|
||||
*/
|
||||
export interface PermissionSet {
|
||||
read: boolean;
|
||||
append: boolean;
|
||||
write: boolean;
|
||||
control: boolean;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ export class SparqlPatchPermissionsExtractor extends PermissionsExtractor {
|
||||
const read = false;
|
||||
const write = this.needsWrite(update);
|
||||
const append = write || this.needsAppend(update);
|
||||
return { read, write, append };
|
||||
const control = false;
|
||||
return { read, write, append, control };
|
||||
}
|
||||
|
||||
private isSparql(data: Representation): data is SparqlUpdatePatch {
|
||||
|
||||
Reference in New Issue
Block a user