summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-08-01 10:55:35 +0200
committerGitHub <noreply@github.com>2019-08-01 10:55:35 +0200
commit2e2d1b6b5c4976a7c5fa999f4950fe9a24f6b173 (patch)
tree3184008cab0278eda0106b17020b13143ad88a80 /lib/private
parenta1afdac31afd1faa51da5015af158db0e3618883 (diff)
parent22b81ac1e446cde2edbade75d03d99fe94f82638 (diff)
downloadnextcloud-server-2e2d1b6b5c4976a7c5fa999f4950fe9a24f6b173.tar.gz
nextcloud-server-2e2d1b6b5c4976a7c5fa999f4950fe9a24f6b173.zip
Merge pull request #16592 from nextcloud/bugfix/noid/federated-reshare
Fix permission check on incoming federated shares
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Share20/Manager.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index bd174069778..2a2c64cf383 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -290,8 +290,10 @@ class Manager implements IManager {
throw new \InvalidArgumentException('A share requires permissions');
}
+ $isFederatedShare = $share->getNode()->getStorage()->instanceOfStorage('\OCA\Files_Sharing\External\Storage');
+ $permissions = 0;
$mount = $share->getNode()->getMountPoint();
- if ($share->getNode()->getOwner()->getUID() !== $share->getSharedBy()) {
+ if (!$isFederatedShare && $share->getNode()->getOwner()->getUID() !== $share->getSharedBy()) {
// When it's a reshare use the parent share permissions as maximum
$userMountPointId = $mount->getStorageRootId();
$userMountPoints = $userFolder->getById($userMountPointId);
@@ -304,7 +306,6 @@ class Manager implements IManager {
/** @var \OCP\Share\IShare[] $incomingShares */
if (!empty($incomingShares)) {
- $permissions = 0;
foreach ($incomingShares as $incomingShare) {
$permissions |= $incomingShare->getPermissions();
}