Merge pull request #39323 from nextcloud/fix/noid/getstorge-before-rm

files_external: getStorage before remove
pull/39366/head
Maxence Lange 2023-07-13 10:52:59 +07:00 committed by GitHub
commit a82291f179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

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