Merge pull request #41124 from nextcloud/backport/41123/stable27

[stable27] fix(external): Get storage before update it
This commit is contained in:
Joas Schilling 2023-10-26 07:58:33 +02:00 committed by GitHub
commit 4fe430ccf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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