protected function ensureAccess($params = [])
    {
        if (!isset($this->checkAccess))
            return;

        $params['action'] = $this;

        if (call_user_func($this->checkAccess, $params))
            return;

        $user = \Yii::$app->user;

        if ($user->getIsGuest())
            $user->loginRequired();
        else
            throw new ForbiddenHttpException(\Yii::t(
                Constants::MSG_CATEGORY_NAME,
                'You are not allowed to perform this action.'
            ));

    }
protected function ensureAccess($params = [])
    {
        if (!isset($this->checkAccess))
            return;

        $params['action'] = $this;

        if (call_user_func($this->checkAccess, $params))
            return;

        $user = \Yii::$app->user;

        if ($user->getIsGuest())
            $user->loginRequired();
        else
            throw new ForbiddenHttpException(\Yii::t(
                Constants::MSG_CATEGORY_NAME,
                'You are not allowed to perform this action.'
            ));

    }
protected function ensureAccess ( $ params = [ ] ) { if ( ! isset ( $ this -> checkAccess ) ) return ; $ params [ 'action' ] = $ this ; if ( call_user_func ( $ this -> checkAccess , $ params ) ) return ; $ user = \ Yii :: $ app -> user ; if ( $ user -> getIsGuest ( ) ) $ user -> loginRequired ( ) ; else throw new ForbiddenHttpException ( \ Yii :: t ( Constants :: MSG_CATEGORY_NAME , 'You are not allowed to perform this action.' ) ) ; }
Ensure this action is allowed for current user
@param array $params Params to be passed to {$this->checkAccess}
@throws ForbiddenHttpException
Ensure this action is allowed for current user