Skip to content

Commit 84ce230

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

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/Service/AttachmentService.php

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

lib/Service/DocumentService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ public function checkSharePermissions(string $shareToken, int $permission = Cons
603603
throw new NotFoundException();
604604
}
605605

606-
if (($share->getPermissions() & $permission) === 0) {
606+
if (($share->getPermissions() & $permission) === 0 || ($share->getNode()->getPermissions() & $permission) === 0) {
607607
throw new NotFoundException();
608608
}
609609
}

0 commit comments

Comments
 (0)