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:
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;
}