Merge pull request #39359 from nextcloud/backport/39323/39323-stable23

[stable23] getStorage before remove
This commit is contained in:
Andy Scherzinger 2023-07-13 21:31:51 +02:00 committed by GitHub
commit 6bc525ee9b
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);
}
}