Skip to content

Commit 644dd7a

Browse files
committed
Some group tests
1 parent f471e44 commit 644dd7a

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

test/integration/acl-oidc-test.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,48 @@ describe('ACL with WebID+OIDC over HTTP', function () {
499499
})
500500
})
501501

502+
describe('Group', function () {
503+
// before(function () {
504+
// rm('/accounts-acl/tim.localhost/group/test-folder/.acl')
505+
// })
506+
507+
// it('should PUT new ACL file', function (done) {
508+
// var options = createOptions('/group/test-folder/.acl', 'user1')
509+
// options.body = '<#Owner> a <http://www.w3.org/ns/auth/acl#Authorization>;\n' +
510+
// ' <http://www.w3.org/ns/auth/acl#accessTo> <./.acl>;\n' +
511+
// ' <http://www.w3.org/ns/auth/acl#agent> <' + user1 + '>;\n' +
512+
// ' <http://www.w3.org/ns/auth/acl#mode> <http://www.w3.org/ns/auth/acl#Read>, <http://www.w3.org/ns/auth/acl#Write>, <http://www.w3.org/ns/auth/acl#Control> .\n' +
513+
// '<#Public> a <http://www.w3.org/ns/auth/acl#Authorization>;\n' +
514+
// ' <http://www.w3.org/ns/auth/acl#accessTo> <./>;\n' +
515+
// ' <http://www.w3.org/ns/auth/acl#agentGroup> <group-listing#folks>;\n' +
516+
// ' <http://www.w3.org/ns/auth/acl#mode> <http://www.w3.org/ns/auth/acl#Read> .\n'
517+
// request.put(options, function (error, response, body) {
518+
// assert.equal(error, null)
519+
// assert.equal(response.statusCode, 201)
520+
// done()
521+
// })
522+
// })
523+
it('user1 should be able to access test directory', function (done) {
524+
var options = createOptions('/group/test-folder/', 'user1')
525+
526+
request.head(options, function (error, response, body) {
527+
assert.equal(error, null)
528+
assert.equal(response.statusCode, 200)
529+
done()
530+
})
531+
})
532+
it('user2 should be able to access test directory',
533+
function (done) {
534+
var options = createOptions('/group/test-folder/', 'user2')
535+
536+
request.head(options, function (error, response, body) {
537+
assert.equal(error, null)
538+
assert.equal(response.statusCode, 200)
539+
done()
540+
})
541+
})
542+
})
543+
502544
describe('Restricted', function () {
503545
var body = '<#Owner> a <http://www.w3.org/ns/auth/acl#Authorization>;\n' +
504546
' <http://www.w3.org/ns/auth/acl#accessTo> <./abc2.ttl>;\n' +
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@prefix : <#>.
2+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
3+
@prefix tes: <./>.
4+
@prefix c: </profile/card#>.
5+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
6+
7+
:owner
8+
acl:accessTo tes:;
9+
acl:agent c:me;
10+
acl:defaultForNew tes:;
11+
acl:mode acl:Control, acl:Read, acl:Write.
12+
:public
13+
acl:accessTo tes:;
14+
acl:agentGroup <group-listing.ttl#folks>;
15+
acl:defaultForNew tes:;
16+
acl:mode acl:Read.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
2+
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
3+
4+
<> a acl:GroupListing.
5+
6+
<#folks>
7+
a vcard:Group;
8+
vcard:hasUID <urn:uuid:8831CBAD-1111-2222-8563-F0F4787EG398:ABGroup> ;
9+
10+
11+
12+
# Simply local and remote identity for myself
13+
vcard:hasMember <https://tim.localhost:7777/profile/card#me>;
14+
vcard:hasMember <https://nicola.localhost:7777/profile/card#me>.

0 commit comments

Comments
 (0)