diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2023-07-13 10:52:59 -0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 10:52:59 -0100 |
commit | a82291f17997e470c84c496731e66e3f3b13c6a3 (patch) | |
tree | 144ab2831728cf7960771872b632ea920e042024 | |
parent | 7c9e5ee397c7b92811199e5fc7a2280fe34e861f (diff) | |
parent | b99020a6f768eb731c8006b0314259afb0f3db04 (diff) | |
download | nextcloud-server-a82291f17997e470c84c496731e66e3f3b13c6a3.tar.gz nextcloud-server-a82291f17997e470c84c496731e66e3f3b13c6a3.zip |
Merge pull request #39323 from nextcloud/fix/noid/getstorge-before-rm
files_external: getStorage before remove
-rw-r--r-- | apps/files_external/lib/Service/UserStoragesService.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index 9a1e4e648b3..6cf34000ab0 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -143,4 +143,10 @@ class UserStoragesService extends StoragesService { protected function isApplicable(StorageConfig $config) { return ($config->getApplicableUsers() === [$this->getUser()->getUID()]) && $config->getType() === StorageConfig::MOUNT_TYPE_PERSONAl; } + + public function removeStorage($id) { + // verify ownership through $this->isApplicable() and otherwise throws an exception + $this->getStorage($id); + parent::removeStorage($id); + } } |