summaryrefslogtreecommitdiffstats
path: root/lib/private/share20/manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/share20/manager.php')
-rw-r--r--lib/private/share20/manager.php16
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 &&