Merge pull request #41131 from nextcloud/backport/41123/stable20

[stable20] fix(external): Get storage before update it
stable20
Joas Schilling 6 months ago committed by GitHub
commit 9757559df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
}

Loading…
Cancel
Save