From ea519e9a6605c7d108e042fd3092de5651f4eb41 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 11 Jul 2023 17:36:17 -0100 Subject: [PATCH] getStorage before remove Signed-off-by: Maxence Lange --- apps/files_external/lib/Service/UserStoragesService.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index 138876f4e1c..f815fe4d306 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -140,4 +140,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); + } } -- 2.39.5