Skip to content

Commit

Permalink
Merge pull request #1548 from nextcloud/fix/share_permissions
Browse files Browse the repository at this point in the history
fix(share): Add owner sharing permission for folder of public share
  • Loading branch information
juliusknorr authored Oct 28, 2024
2 parents 0882cb3 + 681a8a7 commit 2575510
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Db/Collective.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ public function setUserFavoritePages(array $userFavoritePages): void {
}

public function getUserPermissions(bool $isShare = false): int {
// Public shares always get permissions of a simple member
// Public shares always get permissions of a simple member plus sharing permission of owner
if ($isShare) {
return $this->getMemberPermissions();
$sharePermissions = $this->canShare() ? Constants::PERMISSION_SHARE : 0;
return $this->getMemberPermissions() | $sharePermissions;
}

if ($this->level === Member::LEVEL_OWNER || $this->level === Member::LEVEL_ADMIN) {
Expand Down

0 comments on commit 2575510

Please sign in to comment.