diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-07-29 15:00:07 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-07-31 12:59:51 +0200 |
commit | 22b81ac1e446cde2edbade75d03d99fe94f82638 (patch) | |
tree | 971073bec94ee474e03017bc40e96bf84084eaf9 /lib/private | |
parent | f1066fd769cd1e07d1aa67fb620d390d67de2bd9 (diff) | |
download | nextcloud-server-22b81ac1e446cde2edbade75d03d99fe94f82638.tar.gz nextcloud-server-22b81ac1e446cde2edbade75d03d99fe94f82638.zip |
Fix permission check on incoming federated shares
Since federated shares have their permissions set on the node, we do not need
to check for parent share permissions. Otherwise reshares of incoming federated
have no permission variable defined and creating them will fail
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Share20/Manager.php | 5 |
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(); } |