OEModule\OphCoCvi\components\OphCoCvi_AuthRules::canEditOphCoCvi PHP Méthode

canEditOphCoCvi() public méthode

If the view context (containing a Firm and Event) is provided, checks whether the context is correct for editing the given CVI Event object. NB Event checks are purely about view context, and does not account for business rules around the status of the event.
public canEditOphCoCvi ( $user_id, array $view_context = [] ) : boolean
$user_id
$view_context array array containing the currently selected firm and Event for editing
Résultat boolean
    public function canEditOphCoCvi($user_id, $view_context = array())
    {
        if ($this->canCreateOphCoCvi($user_id)) {
            if (isset($view_context['firm'])) {
                return $this->yii->getAuthManager()->executeBizRule('canEditEvent', array($view_context['firm'], $view_context['event']), null);
            } else {
                return true;
            }
        }
        return false;
    }