diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-05-05 18:46:24 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-05-05 21:36:46 +0200 |
commit | a26ca1e638c4b395311bc2d010d0ffd070dbbe2d (patch) | |
tree | 82f68cb0cd797029bd8779c2c8a5005975d5e4b4 /apps/files_sharing/lib/Controller | |
parent | 32e56dee89154aac5ec66cc2dbf10704ee823fba (diff) | |
download | nextcloud-server-a26ca1e638c4b395311bc2d010d0ffd070dbbe2d.tar.gz nextcloud-server-a26ca1e638c4b395311bc2d010d0ffd070dbbe2d.zip |
Do not filter id matching userId on non-user-share shares
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 547c462c84f..49320d57f16 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -221,7 +221,7 @@ class ShareAPIController extends OCSController { if ($this->shareManager->outgoingServer2ServerSharesAllowed()) { if ($share->getShareType() === IShare::TYPE_LINK || $share->getShareType() === IShare::TYPE_EMAIL) { - $result['permissions'] |= Constants::PERMISSION_SHARE; + $result['permissions'] |= Constants::PERMISSION_SHARE; } } @@ -613,12 +613,12 @@ class ShareAPIController extends OCSController { $shares = array_merge($userShares, $groupShares, $circleShares, $roomShares); - $shares = array_filter($shares, function (IShare $share) { + $filteredShares = array_filter($shares, function (IShare $share) { return $share->getShareOwner() !== $this->currentUser; }); $formatted = []; - foreach ($shares as $share) { + foreach ($filteredShares as $share) { if ($this->canAccessShare($share)) { try { $formatted[] = $this->formatShare($share); @@ -791,7 +791,8 @@ class ShareAPIController extends OCSController { continue; } - if (in_array($share->getId(), $known) || $share->getSharedWith() === $this->currentUser) { + if (in_array($share->getId(), $known) + || ($share->getSharedWith() === $this->currentUser && $share->getShareType() === IShare::TYPE_USER)) { continue; } |