feat: Add control permission to PermissionSet

This is in preparation of generalizing permissions
of auxiliary resources.
This commit is contained in:
Joachim Van Herwegen
2021-01-25 11:31:48 +01:00
parent 1486f01aaf
commit 766e6318ba
8 changed files with 24 additions and 10 deletions

View File

@@ -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 };
}
}

View File

@@ -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;
}

View File

@@ -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 {