]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(external): Get storage before update it 41130/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 05:00:25 +0000 (07:00 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/files_external/lib/Service/UserStoragesService.php

index f815fe4d3063862d07fe33113ad4981cd2dbbd09..0ad1d68adb0de1277e9fa4aed3dfaa8191204fa3 100644 (file)
@@ -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);
        }