Merge pull request #39365 from nextcloud/backport/39323/39323-stable19

[stable19] getStorage before remove
This commit is contained in:
Arthur Schiwon 2023-07-17 23:01:59 +02:00 committed by GitHub
commit 64980e6c98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,4 +140,10 @@ class UserStoragesService extends StoragesService {
protected function isApplicable(StorageConfig $config) {
return ($config->getApplicableUsers() === [$this->getUser()->getUID()]) && $config->getType() === StorageConfig::MOUNT_TYPE_PERSONAl;
}
public function removeStorage($id) {
// verify ownership through $this->isApplicable() and otherwise throws an exception
$this->getStorage($id);
parent::removeStorage($id);
}
}