Yii2 how to separate frontend and backend?

How to divide functionality so that after login is shown a template user depending on his role?
To use a behavior, or rbac?
For example:
The user does the authorization, and based on his role, "electric" is displayed on the interface of electrical engineering and pokazhetsja admin interface admin.
And as every time to check who is who so as not to let the electrician in admin?
June 27th 19 at 15:29
2 answers
June 27th 19 at 15:31
June 27th 19 at 15:33
To use a behavior, or rbac?

RBAC

The user does the authorization, and based on his role, "electric" is displayed on the interface of electrical engineering and pokazhetsja admin interface admin.

Depending on the tasks to do or a separate app for each role or individual controllers or just in the view to change the visibility of buttons (roughly speaking). Can be more complex solutions. Depending on the structure of the project. Yii is a very flexible access control based on roles. So everything depends on your imagination and skills.

And all this we do not need basic template, and advanced or your to come up.

PS: do not interfere in a bunch two different tasks. 1 - redirect after login depending on role 2 - restrict access depending on roles. They are implemented separately.

Find more questions by tags Yii