L
L
Lev K2016-06-14 14:52:36
Yii
Lev K, 2016-06-14 14:52:36

How to restrict access to controllers in general, and not individual actions in yii2?

There are several roles and ~8 menu items (added to layouts/main.php) for which a specific controller is responsible. How not to show unavailable menu items? for example, the guest will be immediately given a login form and he will not see anything else, 1 roles will be available 1 and 2 menu items ... roughly so.
basic template

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Bukharev, 2016-06-14
@evgenybuckharev

Dig towards RBAC and business logic for roles, done through the web user method:
Yii::app()->user->checkaccess('....');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question