Merge pull request #39363 from nextcloud/backport/39323/39323-stable20

[stable20] getStorage before remove
pull/39498/head
Arthur Schiwon 10 months ago committed by GitHub
commit 7d870b503b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save