Skip to content

Commit 5395499

Browse files
authored
Merge pull request #7196 from nextcloud/backport/7191/stable27
[stable27] fix: Apply storage checks in addition to share
2 parents 61fd319 + 5748825 commit 5395499

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/Service/AttachmentService.php

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

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)