F
F
First Name2017-05-20 00:07:08
MySQL
First Name, 2017-05-20 00:07:08

How to build RBAC Yii2?

Good day to all.
I just recently started learning Yii2 and needed to learn RBAC.
But no matter how many documentations and manuals I read, I still don’t understand.
Can someone throw me either on an understandable article on how to do it
,
or help
? 6F7iKN .
And then I ran into a problem in the paragraph:

Now in the database you need to create the necessary tables that will store permissions, roles, assignments ... To do this, you can perform the migrations that are in the "box". In the console run: php yii migrate [email protected]/rbac/migrations
This will create 4 tables in the database:
auth_item - this table stores roles and permissions.
auth_item_child - inheritance is set here.
auth_assignment - here users are assigned positions from auth_item. Those. the user (by user ID) can be assigned a role / permission (by name).
auth_rule - this is where the names of rule classes are stored, which are stored in php files.
These tables are currently empty.

BUT I have a "migration" table, but it has 2 columns
wVWTY.jpg
I hope for your help
Thank you in advance for your answers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-20
@webinar

Can someone throw either on an understandable article how to do it, or help

This article helped me at one time >>>
You don’t need to make your own table, especially 1. Run the migrations, besides the user table, 4 more will appear there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question