aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-10-26 08:17:52 +0200
committerGitHub <noreply@github.com>2023-10-26 08:17:52 +0200
commit18be57cb35a0b210a52e845a0c497541bb752ec2 (patch)
tree5d0249a1eb87cad4121e001b67a85505558c7318
parent33c1aafc2eb1480e4c047fabe49a3e168d27e1d8 (diff)
parent4759e7a22dcfc40cc9a467236706ed99a101ca13 (diff)
downloadnextcloud-server-18be57cb35a0b210a52e845a0c497541bb752ec2.tar.gz
nextcloud-server-18be57cb35a0b210a52e845a0c497541bb752ec2.zip
Merge pull request #41123 from nextcloud/bugfix/noid/get-storage-before-updating
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);
}