From bb189784f28e96c87093b9967e4c6b4eaa713369 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 13 Jul 2023 10:18:31 -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 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); + } } -- 2.39.5