Skip to content

Commit a42e4a6

Browse files
provokateurinbackportbot[bot]
authored andcommitted
fix: Respect storage permissions in shares
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 61fd319 commit a42e4a6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Service/AttachmentService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ private function hasUpdatePermissions(string $shareToken): bool {
411411
[IShare::TYPE_LINK, IShare::TYPE_EMAIL, IShare::TYPE_ROOM],
412412
true
413413
)
414-
&& $share->getPermissions() & Constants::PERMISSION_UPDATE);
415-
} catch (ShareNotFound $e) {
414+
&& $share->getNode()->getPermissions() & Constants::PERMISSION_UPDATE);
415+
} catch (ShareNotFound|NotFoundException $e) {
416416
return false;
417417
}
418418
}

lib/Service/DocumentService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ public function checkSharePermissions(string $shareToken, $permission = Constant
588588
throw new NotFoundException();
589589
}
590590

591-
if (($share->getPermissions() & $permission) === 0) {
591+
if (($share->getPermissions() & $permission) === 0 || ($share->getNode()->getPermissions() & $permission) === 0) {
592592
throw new NotFoundException();
593593
}
594594
}

0 commit comments

Comments
 (0)