diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-19 16:07:43 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-19 16:07:43 +0100 |
commit | f8677628d4ce9e47b1c7760291bb41d7d3cf6ed1 (patch) | |
tree | 2821bb7a72af23779b6ef20d058cb79e0d4a417f /lib | |
parent | fb38625741f6e8ca2d9601830a5afa537d43f8ce (diff) | |
parent | 4ef035cc61d1e5f357485d3403357fe745be72d7 (diff) | |
download | nextcloud-server-f8677628d4ce9e47b1c7760291bb41d7d3cf6ed1.tar.gz nextcloud-server-f8677628d4ce9e47b1c7760291bb41d7d3cf6ed1.zip |
Merge pull request #22503 from owncloud/issue_22500
When (re-)sharing an incomming federated share set the corrent owner
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/share20/manager.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php index 4cff3dc818b..9b33e947557 100644 --- a/lib/private/share20/manager.php +++ b/lib/private/share20/manager.php @@ -517,8 +517,20 @@ class Manager implements IManager { // Verify if there are any issues with the path $this->pathCreateChecks($share->getNode()); - // On creation of a share the owner is always the owner of the path - $share->setShareOwner($share->getNode()->getOwner()->getUID()); + /* + * On creation of a share the owner is always the owner of the path + * Except for mounted federated shares. + */ + $storage = $share->getNode()->getStorage(); + if ($storage->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { + $parent = $share->getNode()->getParent(); + while($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { + $parent = $parent->getParent(); + } + $share->setShareOwner($parent->getOwner()->getUID()); + } else { + $share->setShareOwner($share->getNode()->getOwner()->getUID()); + } // Cannot share with the owner if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER && |