getStorage before remove

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/39323/head
Maxence Lange 2023-07-11 17:36:17 +07:00
parent 46247e670a
commit b99020a6f7
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);
}
}