'class' => 'yii\filters\AccessControl',
'rules' => [
[
'actions' => ['site/login', 'site/error'],
'allow' => true,
'roles' => ['admin'],
],
[
'actions' => ['user/index', 'user/view'],
'allow' => true,
'roles' => ['moderator'],
],
],