protected function initModel($id)
    {
        /* @var $model ActiveRecord */
        if ($id === null) {
            $model = new $this->modelClass(['scenario' => $this->createScenario]);
            $model->loadDefaultValues();
        } else {
            $model = $this->findModel($id);
            $model->scenario = $this->updateScenario;
        }

        if ($this->checkAccess) {
            // use only create and update auth item names because more actions are based on this one
            call_user_func($this->checkAccess, $id === null ? 'create' : 'update', $model);
        }
        return $model;
    }