Skip to content

Commit 9bb47e2

Browse files
kjetilkrubensworks
authored andcommitted
Failing tests for case when acl file covers a whole tree
1 parent d12463a commit 9bb47e2

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

test/integration/acl-oidc-test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,39 @@ describe('ACL with WebID+OIDC over HTTP', function () {
424424
done()
425425
})
426426
})
427+
it('user1 should be able to access deep test directory ACL', function (done) {
428+
var options = createOptions('/read-acl/deeper-tree/.acl', 'user1')
429+
request.head(options, function (error, response, body) {
430+
assert.equal(error, null)
431+
assert.equal(response.statusCode, 200)
432+
done()
433+
})
434+
})
435+
it('user1 should not be able to access deep test dir', function (done) {
436+
var options = createOptions('/read-acl/deeper-tree/', 'user1')
437+
request.head(options, function (error, response, body) {
438+
assert.equal(error, null)
439+
assert.equal(response.statusCode, 403)
440+
assert.equal(response.statusMessage, 'User Unauthorized')
441+
done()
442+
})
443+
})
444+
it('user1 should able to access even deeper test directory', function (done) {
445+
var options = createOptions('/read-acl/deeper-tree/acls-only-on-top/', 'user1')
446+
request.head(options, function (error, response, body) {
447+
assert.equal(error, null)
448+
assert.equal(response.statusCode, 200)
449+
done()
450+
})
451+
})
452+
it('user1 should able to access even deeper test file', function (done) {
453+
var options = createOptions('/read-acl/deeper-tree/acls-only-on-top/example.ttl', 'user1')
454+
request.head(options, function (error, response, body) {
455+
assert.equal(error, null)
456+
assert.equal(response.statusCode, 200)
457+
done()
458+
})
459+
})
427460
})
428461

429462
describe('Append-only', function () {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
2+
3+
<#ThisControl> a acl:Authorization ;
4+
acl:accessTo <./> ;
5+
acl:agent <https://tim.localhost:7777/profile/card#me> ;
6+
acl:mode acl:Control .
7+
8+
<#DirRead> a acl:Authorization ;
9+
acl:accessTo <./acls-only-on-top/> ;
10+
acl:agent <https://tim.localhost:7777/profile/card#me> ;
11+
acl:mode acl:Read .
12+
13+
<#FileRead> a acl:Authorization ;
14+
acl:accessTo <./acls-only-on-top/example.ttl> ;
15+
acl:agent <https://tim.localhost:7777/profile/card#me> ;
16+
acl:mode acl:Read .
17+
18+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<> a <http://example.invalid/Dahut> .

0 commit comments

Comments
 (0)