'as beforeRequest' => [
'class' => 'yii\filters\AccessControl',
'rules' => [
[
'controllers ' => [
'mymodule/my-first-controller',
'mymodule/my-second-controller',
],
'allow' => true,
],
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'allow' => true,
'roles' => ['admin'],
],
],
],