Skip to content

Commit 84e856c

Browse files
committed
Added special handling for root
To not break old PODs that have a root ACL that doesn't give READ access to root - will check for the ACL for the representation that is served back for root Hopefully making things a bit easier to read Added comment about the hack
1 parent 5e62f8c commit 84e856c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/handlers/allow.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ function allow (mode, checkPermissionsForDirectory) {
5454
return next()
5555
}
5656
if (mode === 'Read' && (resourcePath === '' || resourcePath === '/')) {
57+
// This is a hack to make NSS check the ACL for representation that is served for root (if any)
58+
// See https://github.com/solid/node-solid-server/issues/1063 for more info
5759
const representationUrl = await ldp.resourceMapper.getRepresentationUrlForResource(resourceUrl)
5860
req.acl = ACL.createFromLDPAndRequest(representationUrl, ldp, req)
5961
const representationIsAllowed = await req.acl.can(userId, mode)

0 commit comments

Comments
 (0)