feat: Add permissions extractor for acl resources

This commit is contained in:
Joachim Van Herwegen
2021-01-29 16:48:09 +01:00
parent 758f5ed083
commit 8339413ab4
8 changed files with 94 additions and 26 deletions

View File

@@ -29,12 +29,11 @@ export class AclHelper {
'<http://test.com/#auth> a acl:Authorization',
];
for (const perm of [ 'Read', 'Append', 'Write', 'Delete' ]) {
for (const perm of [ 'Read', 'Append', 'Write', 'Control' ]) {
if (permissions[perm.toLowerCase() as keyof PermissionSet]) {
acl.push(`;\n acl:mode acl:${perm}`);
}
}
acl.push(';\n acl:mode acl:Control');
acl.push(`;\n acl:accessTo <${this.id}>`);
acl.push(`;\n acl:default <${this.id}>`);
acl.push(