From 6c98f951d5bd278765bd0c12aba15f38de6cecf1 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 13 Jul 2023 10:18:31 -0100 Subject: getStorage before remove Signed-off-by: Maxence Lange --- apps/files_external/lib/Service/UserStoragesService.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apps') 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); + } } -- cgit v1.2.3