]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(external): Get storage before update it 41125/head
authorJoas Schilling <coding@schilljs.com>
Tue, 17 Oct 2023 13:22:21 +0000 (15:22 +0200)
committerJoas Schilling <coding@schilljs.com>
Thu, 26 Oct 2023 04:57:21 +0000 (06:57 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/files_external/lib/Service/UserStoragesService.php

index 6cf34000ab0098b1f1f07ac234763ddc80d24dfb..47a6e919853aba3fef28491d4fc8159faafb88e3 100644 (file)
@@ -127,6 +127,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);
        }