Skip to content

Commit a242131

Browse files
committed
move Read requirement in PATCH to the DELETE part
1 parent 004dfe8 commit a242131

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/WAC.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,7 @@ public function getRequestedGrants($request) {
360360
break;
361361
case "PATCH";
362362
$grants = array();
363-
if ($this->filesystem->has($path)) {
364-
$grants[] = array(
365-
"type" => "resource",
366-
"grants" => array(
367-
'http://www.w3.org/ns/auth/acl#Read'
368-
)
369-
);
370-
} else {
363+
if (!$this->filesystem->has($path)) {
371364
$grants[] = array(
372365
"type" => "parent",
373366
"grants" => array(
@@ -385,6 +378,12 @@ public function getRequestedGrants($request) {
385378
"type" => "resource",
386379
"grants" => array('http://www.w3.org/ns/auth/acl#Write')
387380
);
381+
// To delete a triple from a resource, you need to be able to know that the triple is there.
382+
// which requires Read;
383+
$grants[] = array(
384+
"type" => "resource",
385+
"grants" => array('http://www.w3.org/ns/auth/acl#Read')
386+
);
388387
}
389388
if (strstr($body, "INSERT")) {
390389
if ($this->filesystem->has($path)) {

0 commit comments

Comments
 (0)