From: Maxence Lange Date: Thu, 13 Jul 2023 11:18:31 +0000 (-0100) Subject: getStorage before remove X-Git-Tag: v26.0.4rc1~1^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bb189784f28e96c87093b9967e4c6b4eaa713369;p=nextcloud-server.git getStorage before remove Signed-off-by: Maxence Lange --- 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); + } }