diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index 32af0dd84e34c..50abe44b74d94 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -17,6 +17,7 @@ use OCP\Files\Config\IAuthoritativeMountProvider; use OCP\Files\Config\IMountProvider; use OCP\Files\Config\IPartialMountProvider; +use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountManager; use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage\IStorageFactory; @@ -262,6 +263,7 @@ public function getMountsFromSuperShares( $newMaxValidatedShare = $maxValidatedShare; $appConfig = Server::get(IAppConfig::class); $cacheDependencies = Server::get(CacheDependencies::class); + $rootFolder = Server::get(IRootFolder::class); foreach ($superShares as $share) { [$parentShare, $groupedShares] = $share; @@ -293,6 +295,7 @@ public function getMountsFromSuperShares( 'shareManager' => $this->shareManager, 'appConfig' => $appConfig, 'cacheDependencies' => $cacheDependencies, + 'rootFolder' => $rootFolder, ], $loader, $this->eventDispatcher, diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 827061c032c2d..e2cf9abb20cfa 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -94,6 +94,7 @@ class SharedStorage extends Jail implements LegacyISharedStorage, ISharedStorage */ private static int $initDepth = 0; private CacheDependencies $cacheDependencies; + private IRootFolder $rootFolder; public function __construct(array $parameters) { $this->ownerView = $parameters['ownerView']; @@ -101,6 +102,7 @@ public function __construct(array $parameters) { $this->appConfig = $parameters['appConfig'] ?? Server::get(IAppConfig::class); $this->shareManager = $parameters['shareManager'] ?? Server::get(IShareManager::class); $this->cacheDependencies = $parameters['cacheDependencies'] ?? Server::get(CacheDependencies::class); + $this->rootFolder = $parameters['rootFolder'] ?? Server::get(IRootFolder::class); $this->superShare = $parameters['superShare']; $this->groupedShares = $parameters['groupedShares']; @@ -160,9 +162,7 @@ private function init() { throw new \Exception('Maximum share depth reached'); } - /** @var IRootFolder $rootFolder */ - $rootFolder = Server::get(IRootFolder::class); - $this->ownerUserFolder = $rootFolder->getUserFolder($this->superShare->getShareOwner()); + $this->ownerUserFolder = $this->rootFolder->getUserFolder($this->superShare->getShareOwner()); $sourceId = $this->superShare->getNodeId(); $ownerNodes = $this->ownerUserFolder->getById($sourceId);