V
V
Valeriy Donika2015-01-18 14:25:16
Yii
Valeriy Donika, 2015-01-18 14:25:16

YII2 RBAC DbManager. How to implement?

Good afternoon. Specified in the config

return [
    // ...
    'components' => [
        'authManager' => [
            'class' => 'yii\rbac\DbManager',
        ],
        // ...
    ],
];

Then I created the tables using the migrate command.
Read www.yiiframework.com/doc-2.0/guide-security-author ... manual. But I still don't understand a couple of things. Should I create roles in the table myself? It's just that the manual says how they are created in a small number, when the structure does not change, we create a team. How to do it dynamically?
My application is basic.
https://www.youtube.com/watch?v=eFOIUeU-Y74&index=... Here I look, he adds it to the database. But this is for an example. So how should it be?
Can you tell me where to create this miracle? In which folder, etc.
And finally, how to restrict access to the module using RBAC?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zelenin, 2015-01-18
@zelenin

when creating a user, assign him a role

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question