From 1052feabede4b9054047f60aaa6fe4e04e89c434 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 26 Mar 2021 15:07:39 +0100 Subject: remove depricated methods from MountConfig Signed-off-by: Robin Appelman --- lib/private/Encryption/File.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/private/Encryption/File.php') diff --git a/lib/private/Encryption/File.php b/lib/private/Encryption/File.php index 76d8900a40e..2c486dfade6 100644 --- a/lib/private/Encryption/File.php +++ b/lib/private/Encryption/File.php @@ -28,6 +28,7 @@ namespace OC\Encryption; use OC\Cache\CappedMemoryCache; +use OCA\Files_External\Service\GlobalStoragesService; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\Share\IManager; @@ -110,10 +111,12 @@ class File implements \OCP\Encryption\IFile { // check if it is a group mount if (\OCP\App::isEnabled("files_external")) { - $mounts = \OCA\Files_External\MountConfig::getSystemMountPoints(); - foreach ($mounts as $mount) { - if ($mount['mountpoint'] == substr($ownerPath, 1, strlen($mount['mountpoint']))) { - $mountedFor = $this->util->getUserWithAccessToMountPoint($mount['applicable']['users'], $mount['applicable']['groups']); + /** @var GlobalStoragesService $storageService */ + $storageService = \OC::$server->get(GlobalStoragesService::class); + $storages = $storageService->getAllStorages(); + foreach ($storages as $storage) { + if ($storage->getMountPoint() == substr($ownerPath, 0, strlen($storage->getMountPoint()))) { + $mountedFor = $this->util->getUserWithAccessToMountPoint($storage->getApplicableUsers(), $storage->getApplicableGroups()); $userIds = array_merge($userIds, $mountedFor); } } -- cgit v1.2.3