public function hasAccess($action, $model = null, $params = [])
    {
        return Yii::$app->user->can(
            $this->modelClass.'.'.$action,
            array_merge($params, $model === null ? [] : ['model' => $model])
        );
    }
public function hasAccess($action, $model = null, $params = [])
    {
        return Yii::$app->user->can(
            $this->modelClass.'.'.$action,
            array_merge($params, $model === null ? [] : ['model' => $model])
        );
    }
public function hasAccess ( $ action , $ model = null , $ params = [ ] ) { return Yii :: $ app -> user -> can ( $ this -> modelClass . '.' . $ action , array_merge ( $ params , $ model === null ? [ ] : [ 'model' => $ model ] ) ) ; }
Checks the privilege of the current user.

This method should be overridden to check whether the current user has the privilege
to run the specified action against the specified data model.

@param string $action the ID of the action to be executed
@param object $model the model to be accessed. If null, it means no specific model is being accessed.
@param array $params additional parameters
@return bool
Checks the privilege of the current user .