Skip to content

Commit

Permalink
Append access suffice to create
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Jun 14, 2022
1 parent a2b986a commit 290bbde
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions test/surface/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ describe('Create', () => {
});
}
testAllowed('Write', 'Write');
testAllowed('Write', 'Append');
testAllowed('Append', 'Write');
testAllowed('Append', 'Append');

it(`is disallowed without default Write`, async () => {
it(`is disallowed without default Write or Append`, async () => {
const testing = `test-disallowed-default`;
const containerUrl = makeContainerUrl(testFolderUrl, using, testing);
// This will do mkdir-p:
Expand All @@ -202,7 +204,7 @@ describe('Create', () => {
const aclDocUrl = await solidLogicAlice.findAclDocUrl(containerUrl);
await solidLogicAlice.fetch(aclDocUrl, {
method: 'PUT',
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Append, acl:Control', containerUrl),
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Control', containerUrl),
headers: {
'Content-Type': 'text/turtle',
// 'If-None-Match': '*' - work around a bug in some servers that don't support If-None-Match on ACL doc URLs
Expand Down Expand Up @@ -290,9 +292,11 @@ describe('Create', () => {
});
}
testAllowed('Write', 'Write');
testAllowed('Write', 'Append');
testAllowed('Append', 'Write');
testAllowed('Append', 'Append');

it(`is disallowed without default Write`, async () => {
it(`is disallowed without default Write or Append`, async () => {
const testing = `test-disallowed-default`;
const containerUrl = makeContainerUrl(testFolderUrl, using, testing);
// This will do mkdir-p:
Expand All @@ -307,7 +311,7 @@ describe('Create', () => {
const aclDocUrl = await solidLogicAlice.findAclDocUrl(containerUrl);
await solidLogicAlice.fetch(aclDocUrl, {
method: 'PUT',
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Append, acl:Control', containerUrl),
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Control', containerUrl),
headers: {
'Content-Type': 'text/turtle',
// 'If-None-Match': '*' - work around a bug in some servers that don't support If-None-Match on ACL doc URLs
Expand Down Expand Up @@ -400,9 +404,11 @@ describe('Create', () => {
});
}
testAllowed('Write', 'Write');
testAllowed('Write', 'Append');
testAllowed('Append', 'Write');
testAllowed('Append', 'Append');

it(`is disallowed without default Write`, async () => {
it(`is disallowed without default Write or Append`, async () => {
const testing = `disallowed-default`;
const containerUrl = makeContainerUrl(testFolderUrl, using, testing);
// This will do mkdir-p:
Expand All @@ -417,7 +423,7 @@ describe('Create', () => {
const aclDocUrl = await solidLogicAlice.findAclDocUrl(containerUrl);
await solidLogicAlice.fetch(aclDocUrl, {
method: 'PUT',
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Append, acl:Control', containerUrl),
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Control', containerUrl),
headers: {
'Content-Type': 'text/turtle',
// 'If-None-Match': '*' - work around a bug in some servers that don't support If-None-Match on ACL doc URLs
Expand Down Expand Up @@ -507,10 +513,12 @@ describe('Create', () => {
});
}
testAllowed('Write', 'Write');
testAllowed('Write', 'Append');
testAllowed('Append', 'Write');
testAllowed('Append', 'Append');


it(`is disallowed without default Write`, async () => {
it(`is disallowed without default Write or Append`, async () => {
const testing = `disallowed-default`;
const containerUrl = makeContainerUrl(testFolderUrl, using, testing);
// This will do mkdir-p:
Expand All @@ -525,7 +533,7 @@ describe('Create', () => {
const aclDocUrl = await solidLogicAlice.findAclDocUrl(containerUrl);
await solidLogicAlice.fetch(aclDocUrl, {
method: 'PUT',
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Append, acl:Control', containerUrl),
body: makeBody('acl:Read, acl:Append, acl:Write, acl:Control', 'acl:Read, acl:Control', containerUrl),
headers: {
'Content-Type': 'text/turtle',
// 'If-None-Match': '*' - work around a bug in some servers that don't support If-None-Match on ACL doc URLs
Expand Down

0 comments on commit 290bbde

Please sign in to comment.