Skip to content

Commit 3d083e6

Browse files
authored
Merge pull request #7195 from nextcloud/backport/7191/stable28
[stable28] fix: Apply storage checks in addition to share
2 parents cb627d7 + 9506017 commit 3d083e6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/Service/AttachmentService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,9 @@ 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->getPermissions() & Constants::PERMISSION_UPDATE
416+
&& $share->getNode()->getPermissions() & Constants::PERMISSION_UPDATE);
417+
} catch (ShareNotFound|NotFoundException $e) {
417418
return false;
418419
}
419420
}

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)