Answer the question
In order to leave comments, you need to log in
YII2 how to restrict access?
I wanted to restrict access to gii through a role, but something did not work out. I did it in the config and like this:
'gii' => [
'class' => 'yii\gii\Module',
'as access' => [
'class' => 'yii\filters\AccessControl',
'rules' => [
[
'allow' => true,
'roles' => ['admin'],
],
]
],
],
Answer the question
In order to leave comments, you need to log in
The generator should be available only for the Dev environment (local machine of the developer) and should not be connected to the prod at all. Do not do it this way
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question