Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Require Write on c/r for PATCH-to-create, fix solid-contrib/test-suit…
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Jun 30, 2022
1 parent 9ecb769 commit 3462caa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/authorization/permissions/N3PatchModesExtractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ export class N3PatchModesExtractor extends ModesExtractor {
// When ?insertions is non-empty, servers MUST (also) treat the request as an Append operation.
if (inserts.length > 0) {
accessModes.add(AccessMode.append);
// require Write on c/r and Append-or-Write on c/
// for PATCH-to-create c/r
// ref https://github.com/solid-contrib/test-suite/issues/146
if (!await this.resourceSet.hasResource(target)) {
accessModes.add(AccessMode.write);
accessModes.add(AccessMode.create);
}
}
Expand Down

0 comments on commit 3462caa

Please sign in to comment.