diff options
author | Robin Appelman <robin@icewind.nl> | 2023-08-18 14:09:03 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2023-08-18 14:09:03 +0200 |
commit | e98e8f10c9126f02fa6d2a5877fe52b454438c2f (patch) | |
tree | c538c4e8d3929947b414023693ffc2f36a6c6ccc /lib/private | |
parent | c7035eec05d40ec595135691cb00a25b452d655c (diff) | |
download | nextcloud-server-e98e8f10c9126f02fa6d2a5877fe52b454438c2f.tar.gz nextcloud-server-e98e8f10c9126f02fa6d2a5877fe52b454438c2f.zip |
improve performance of calculating dav permissions
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/FileInfo.php | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index 2b6b83a2546..3937ee16a7c 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -32,7 +32,9 @@ */ namespace OC\Files; +use OCA\Files_Sharing\ISharedStorage; use OCP\Files\Cache\ICacheEntry; +use OCP\Files\IHomeStorage; use OCP\Files\Mount\IMountPoint; use OCP\IUser; @@ -313,27 +315,13 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return bool */ public function isShared() { - $sid = $this->getStorage()->getId(); - if (!is_null($sid)) { - $sid = explode(':', $sid); - return ($sid[0] === 'shared'); - } - - return false; + $storage = $this->getStorage(); + return $storage->instanceOfStorage(ISharedStorage::class); } public function isMounted() { $storage = $this->getStorage(); - if ($storage->instanceOfStorage('\OCP\Files\IHomeStorage')) { - return false; - } - $sid = $storage->getId(); - if (!is_null($sid)) { - $sid = explode(':', $sid); - return ($sid[0] !== 'home' and $sid[0] !== 'shared'); - } - - return false; + return !($storage->instanceOfStorage(IHomeStorage::class) || $storage->instanceOfStorage(ISharedStorage::class)); } /** |