M
M
masimka2017-04-07 11:50:20
Yii
masimka, 2017-04-07 11:50:20

How to separate frontend and backend in yii2?

How to separate the functionality, so that after authorization a user template would be shown depending on his role?
Use behavior or rbac?
For example:
A user logs in, and based on his role, "electric" shows the electrician interface, and admin shows the admin interface.
And how to check every time who is who in order not to let the electrician into the admin?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Bukharev, 2017-04-07
@evgenybuckharev

www.yiiframework.com/wiki/848/installation-guide-y...

M
Maxim Timofeev, 2017-04-08
@webinar

Use behavior or rbac?

RBAC
Depending on the task, make either a separate app for each role, or separate controllers, or simply change the visibility of the buttons in the view (roughly speaking). There may be more complex solutions. It all depends on the structure of the project. Yii has very flexible role-based access control. So it all depends on imagination and skill.
Yes, and all this should be done not on a basic template, but on an advanced one or come up with your own.
PS: don't mix two different tasks together. 1 - redirect after login depending on the role and 2 - access restriction depending on the role. They are sold separately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question