protected function denyAccess($user)
{
$rr = new RequestResponse();
if ($user->getIsGuest()) {
$authUrl = UrlHelper::construct(["/cms/auth/login"])->setCurrentRef()->createUrl();
if (\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax) {
\Yii::$app->getResponse()->redirect($authUrl);
$rr->redirect = $authUrl;
return (array) $rr;
} else {
\Yii::$app->getResponse()->redirect($authUrl);
}
} else {
throw new ForbiddenHttpException(\Yii::t('yii', 'You are not allowed to perform this action.'));
}
}