Answer the question
In order to leave comments, you need to log in
Error when authenticating in Yii2?
public function beforeAction($action){
if (parent::beforeAction($action)) {
if (!\Yii::$app->user->can($action->id)) {
echo 'Ошибка доступа';
}
return true;
} else {
return false;
}
}
Answer the question
In order to leave comments, you need to log in
access rules.
Google rbac.
Roughly speaking, you don't have the authorization action for the guest allowed, and therefore the script throws an error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question