S
S
Stepan2015-01-26 16:17:12
Yii
Stepan, 2015-01-26 16:17:12

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;
        }
    }

Almost finished user authentication through the database. But this is where it throws an error.
Tell me what it means /
Displays "Access error"
Authentication does not occur if manually returned true. This creates PHPSESSID and creates _identify

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2015-01-26
@xoma2

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 question

Ask a Question

731 491 924 answers to any question