A
A
Alexander Nevsky2018-11-13 20:46:40
Yii
Alexander Nevsky, 2018-11-13 20:46:40

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'],
      ],
    ]
  ],
],

RBAC is configured. Tell me what's wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2018-11-13
@soy4er

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 question

Ask a Question

731 491 924 answers to any question