Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-05-05 19:46:24 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-05-05 22:36:46 +0300
commita26ca1e638c4b395311bc2d010d0ffd070dbbe2d (patch)
tree82f68cb0cd797029bd8779c2c8a5005975d5e4b4 /apps/files_sharing/lib/Controller/ShareAPIController.php
parent32e56dee89154aac5ec66cc2dbf10704ee823fba (diff)
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/ShareAPIController.php')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php9
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;
}