aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/MountProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/MountProvider.php')
-rw-r--r--apps/files_sharing/lib/MountProvider.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php
index f2fc45dae4e..cc29a8ce686 100644
--- a/apps/files_sharing/lib/MountProvider.php
+++ b/apps/files_sharing/lib/MountProvider.php
@@ -27,6 +27,7 @@
namespace OCA\Files_Sharing;
+use OC\Files\View;
use OCP\Files\Config\IMountProvider;
use OCP\Files\Storage\IStorageFactory;
use OCP\IConfig;
@@ -84,19 +85,29 @@ class MountProvider implements IMountProvider {
$superShares = $this->buildSuperShares($shares, $user);
$mounts = [];
+ $view = new View('/' . $user->getUID() . '/files');
+ $ownerViews = [];
foreach ($superShares as $share) {
try {
+ /** @var \OCP\Share\IShare $parentShare */
+ $parentShare = $share[0];
+ $owner = $parentShare->getShareOwner();
+ if (!isset($ownerViews[$owner])) {
+ $ownerViews[$owner] = new View('/' . $parentShare->getShareOwner() . '/files');
+ }
$mount = new SharedMount(
'\OCA\Files_Sharing\SharedStorage',
$mounts,
[
'user' => $user->getUID(),
// parent share
- 'superShare' => $share[0],
+ 'superShare' => $parentShare,
// children/component of the superShare
'groupedShares' => $share[1],
+ 'ownerView' => $ownerViews[$owner]
],
- $storageFactory
+ $storageFactory,
+ $view
);
$mounts[$mount->getMountPoint()] = $mount;
} catch (\Exception $e) {