aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2023-07-13 10:52:59 -0100
committerGitHub <noreply@github.com>2023-07-13 10:52:59 -0100
commita82291f17997e470c84c496731e66e3f3b13c6a3 (patch)
tree144ab2831728cf7960771872b632ea920e042024
parent7c9e5ee397c7b92811199e5fc7a2280fe34e861f (diff)
parentb99020a6f768eb731c8006b0314259afb0f3db04 (diff)
downloadnextcloud-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.php6
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);
+ }
}