Access controle to RBAC module
ilyatau opened this issue · comments
Hello,
I can control access to all my controllers with you rbac module.
But I can't close access to rbac module it self.
Or I don't understand something.
Thanks
Hi, you can add rbac module to the admin module. And then only the users that have access rights to the admin panel of the website will be able to have access to the rbac module.
You can install our base template. In this template only user with admin role has access to the rbac module.
I am using advanced template. And try use rbac module in backend app.
I found way for solution.
You can add to config this code
'modules' => [
......
'rbac' => [
'class' => 'yii2mod\rbac\Module',
'as access' => [
'class' => yii2mod\rbac\components\AccessControl::className()
],
//Some controller property maybe need to change.
'controllerMap' => [
'assignment' => [
'class' => 'yii2mod\rbac\controllers\AssignmentController',
'userClassName' => 'path\to\models\User',
]
]
],
]
Please add this example to you readme file. Maybe it will help to other users.
ok, thanks