aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2023-07-13 10:18:31 -0100
committerMaxence Lange <maxence@artificial-owl.com>2023-07-13 10:18:31 -0100
commit6c98f951d5bd278765bd0c12aba15f38de6cecf1 (patch)
tree1e8d0e0f0f60999a87c18805924db976380697b0 /apps
parent1cb90e2cc1d1d53cc2cd42dcbdd981b659960b53 (diff)
downloadnextcloud-server-6c98f951d5bd278765bd0c12aba15f38de6cecf1.tar.gz
nextcloud-server-6c98f951d5bd278765bd0c12aba15f38de6cecf1.zip
getStorage before remove
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'apps')
-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);
+ }
}