From: Joas Schilling Date: Tue, 17 Oct 2023 13:22:21 +0000 (+0200) Subject: fix(external): Get storage before update it X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=984db91a717371703b40e180ea80099023129256;p=nextcloud-server.git fix(external): Get storage before update it Signed-off-by: Joas Schilling --- diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index f815fe4d306..0ad1d68adb0 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -124,6 +124,9 @@ class UserStoragesService extends StoragesService { * @throws NotFoundException if the given storage does not exist in the config */ public function updateStorage(StorageConfig $updatedStorage) { + // verify ownership through $this->isApplicable() and otherwise throws an exception + $this->getStorage($updatedStorage->getId()); + $updatedStorage->setApplicableUsers([$this->getUser()->getUID()]); return parent::updateStorage($updatedStorage); }