Skip to content

Commit 8c925c0

Browse files
Adapt to WAC tests v6.0.0
1 parent 9114c43 commit 8c925c0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/acl-checker.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ class ACLChecker {
9898
// debugCache('accessDenied result ' + accessDenied)
9999
}
100100
}
101+
102+
// For delete HTTP method
103+
if ((method === 'DELETE') && directory) {
104+
// if resource and acl have same parent container,
105+
// then accessTo Write from parent is required
106+
if (directory.value === dirname(aclFile.value) + '/') {
107+
const accessDeniedAccessTo = aclCheck.accessDenied(acl.graph, directory, null, aclFile, agent, [ACL('Write')], agentOrigin, trustedOrigins, originTrustedModes)
108+
const accessResult = !accessDenied && !accessDeniedAccessTo
109+
accessDenied = accessResult ? false : accessDenied || accessDeniedAccessTo
110+
// debugCache('accessDenied result ' + accessDenied)
111+
}
112+
}
101113
if (accessDenied && user) {
102114
this.messagesCached[cacheKey].push(HTTPError(403, accessDenied))
103115
} else if (accessDenied) {

test/surface/run-solid-test-suite.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ waitForNss server
4949
runTests webid-provider-tests v2.0.3
5050
runTests solid-crud-tests nss-skips
5151
waitForNss thirdparty
52-
runTests web-access-control-tests v5.1.0
52+
runTests web-access-control-tests v6.0.0
5353
teardown
5454

5555
# To debug, e.g. running web-access-control-tests jest interactively,

0 commit comments

Comments
 (0)