X
X
xuxubla2016-11-14 06:24:19
Yii
xuxubla, 2016-11-14 06:24:19

Why doesn't dektrium/yii2-rbac work out of the box?

I installed pure yii2, installed dektrium/yii2-rbac. As written in the manual, I performed the migration. I didn't configure authManager beforehand. Here is my config file:

'components' => [
    'request' => [
        'cookieValidationKey' => 'asdasd123456qwerty',
    ],
    'cache' => [...],
    'user' => [
        'identityClass' => 'app\models\User',
        'enableAutoLogin' => true,
    ],
    'errorHandler' => [...],
    'mailer' => [...],
    'log' => [...],
    'db' => require(__DIR__ . '/db-local.php'),
    'urlManager' => [...],
],
'params' => $params,
'modules' => [
    'rbac' => 'dektrium\rbac\RbacWebModule',
],

I added to the console config:
'modules' => [
    'rbac' => 'dektrium\rbac\RbacWebModule',
],

When I go to localhost/basic/web/rbac (it asks me to login admin/admin), I get an error (403 Forbidden). What am I missing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-11-14
@webinar

You do not have access rights. It is necessary to look at the rights for the action login, in theory, all users should have access. Or, as an option, he logs you in, but then redirects to a page for which you do not have rights.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question