getStorage before remove

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/39363/head
Maxence Lange 10 months ago
parent 34eface515
commit 596b8e58cc

@ -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