getStorage before remove

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/39362/head
Maxence Lange 10 months ago
parent 59e117cb6a
commit ea519e9a66

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