public function beforeAction($action)
{
if (!parent::beforeAction($action)) {
return false;
}
if (Yii::$app instanceof \yii\web\Application && !$this->checkAccess($action)) {
throw new ForbiddenHttpException('You are not allowed to access this page.');
}
return true;
}