Merge pull request #39362 from nextcloud/backport/39323/stable21-39323

[stable21] getStorage before remove
pull/39423/head
Andy Scherzinger 10 months ago committed by GitHub
commit 000214105f
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