A
A
Alexander Laikov2017-02-23 20:14:17
Yii
Alexander Laikov, 2017-02-23 20:14:17

How to prevent some users from accessing modules?

Good afternoon!
There is an admin module. How can I prevent some users from accessing this module?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2017-02-23
@Florens

Good evening.
Use RBAC

A
Andrew, 2017-02-23
@mhthnz

In the config:

'modules' = [
    'admin' => [
        'class' => 'admin\Module',
        'as access' => [
            'class' => 'yii\filters\AccessControl',
            'rules' => [
                [
                    'allow' => true,
                    'roles' => ['admin'],
                ],
            ],
        ],
    ],
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question