OEModule\OphCoCvi\components\OphCoCvi_AuthRules::canCreateOphCoCvi PHP Method

canCreateOphCoCvi() public method

If the view context (containing a Firm and Episode) is provided, checks whether the context is correct for creating a CVI event in the episode.
public canCreateOphCoCvi ( $user_id, array $view_context = [] ) : boolean
$user_id
$view_context array
return boolean
    public function canCreateOphCoCvi($user_id, $view_context = array())
    {
        if ($this->canEdit($user_id, true)) {
            if (isset($view_context['firm'])) {
                return $this->yii->getAuthManager()->executeBizRule('canCreateEvent', array($view_context['firm'], $view_context['episode'], $this->getEventType()), null);
            } else {
                return true;
            }
        }
        return false;
    }