Merge pull request #39356 from nextcloud/backport/39323/39323-stable25

[stable25] getStorage before remove
This commit is contained in:
Andy Scherzinger 2023-07-13 14:10:25 +02:00 committed by GitHub
commit 166c63b8ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,4 +143,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);
}
}