Skip to content

Commit 273f212

Browse files
kjetilkrubensworks
authored andcommitted
Check for ACL files and remove ending for resource
1 parent 34481f3 commit 273f212

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

lib/acl-checker.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ class ACLChecker {
3333
return this.aclCached[cacheKey]
3434
}
3535
this.messagesCached[cacheKey] = this.messagesCached[cacheKey] || []
36-
// If this is an ACL, Control mode must be present for any operations
37-
if (this.isAcl(this.resource)) {
38-
mode = 'Control'
39-
}
36+
37+
// Obtain the permission set for the resource
38+
// this.acl.graph
39+
// this.resource
40+
// this.acl.isContainer ? this.resource : null
41+
// this.acl.acl
42+
// user
43+
// ACL(mode)
44+
// this.origin
45+
// this.trustedOrigins
4046

4147
// console.log('ACL', this.origin, this.trustedOrigins)
4248
// console.log(aclCheck.accessDenied)
@@ -61,6 +67,11 @@ class ACLChecker {
6167
// Then, the ACL file is for a directory
6268
resource = rdf.sym(ACLChecker.getDirectory(this.resource))
6369
}
70+
// If this is an ACL, Control mode must be present for any operations
71+
if (this.isAcl(this.resource)) {
72+
mode = 'Control'
73+
resource = rdf.sym(this.resource.substring(0, this.resource.length - this.suffix.length))
74+
}
6475
// const directory = acl.isContainer ? this.resource : null
6576
const directory = acl.isContainer ? rdf.sym(ACLChecker.getDirectory(acl.acl)) : null
6677
// console.log(ACLChecker.getDirectory(acl.acl))

0 commit comments

Comments
 (0)