/** * Throw exception if ria user has not ROLE_RIA role * * @param User $ria * @throws \InvalidArgumentException */ private function checkIsRiaUser(User $ria) { if (!$ria->hasRole('ROLE_RIA')) { throw new \InvalidArgumentException('User does not have ria permissions.'); } }