summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-10-26 07:58:33 +0200
committerGitHub <noreply@github.com>2023-10-26 07:58:33 +0200
commit4fe430ccf21f8f001e6905784f06d3d0a01946b4 (patch)
tree74aee03b71f7d75c67d2faec5d6cc61a72fa2fdc
parent84c153e34cbdb1f601f28f4415dd5aedc353b494 (diff)
parent7105380511c19079d07899e907dac9c18b4e7565 (diff)
downloadnextcloud-server-4fe430ccf21f8f001e6905784f06d3d0a01946b4.tar.gz
nextcloud-server-4fe430ccf21f8f001e6905784f06d3d0a01946b4.zip
Merge pull request #41124 from nextcloud/backport/41123/stable27
[stable27] fix(external): Get storage before update it
-rw-r--r--apps/files_external/lib/Service/UserStoragesService.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php
index 6cf34000ab0..47a6e919853 100644
--- a/apps/files_external/lib/Service/UserStoragesService.php
+++ b/apps/files_external/lib/Service/UserStoragesService.php
@@ -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);
}