summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2023-07-11 17:36:17 -0100
committerMaxence Lange <maxence@artificial-owl.com>2023-07-13 10:41:04 -0100
commit3af516921ca1f61ee43cc76284b3221710daaf36 (patch)
tree0326f78f62558f20fddf6cadad68c68cf885c76b
parent4f785156160f4020b6cbc74e73c3de70276a9f81 (diff)
downloadnextcloud-server-3af516921ca1f61ee43cc76284b3221710daaf36.tar.gz
nextcloud-server-3af516921ca1f61ee43cc76284b3221710daaf36.zip
getStorage before remove
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-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 b09b37b40cc..59682874038 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);
+ }
}