aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-10-26 09:35:54 +0200
committerGitHub <noreply@github.com>2023-10-26 09:35:54 +0200
commit9757559df305ca492d273f90927ed2e9a7f630f2 (patch)
tree947204ae0e5ddb46fabda9fd8a821475e803dbbf
parent3f61e6d1960d524a7061902435c0b5dfd1404ca8 (diff)
parentd4946b6bfaee50382cf2eb7e9b960e4eba642099 (diff)
downloadnextcloud-server-stable20.tar.gz
nextcloud-server-stable20.zip
Merge pull request #41131 from nextcloud/backport/41123/stable20stable20
[stable20] 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 3f4d08b1ea0..04f8a321c14 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);
}