Merge pull request #41125 from nextcloud/backport/41123/stable26

[stable26] fix(external): Get storage before update it
This commit is contained in:
Joas Schilling 2023-10-26 07:58:24 +02:00 committed by GitHub
commit c528b88b4f
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);
}