[ 'class' => AccessControl::className(), 'rules' => [ [ 'actions' => ['error'], 'allow' => true, ], [ 'actions' => ['index','groups','tasks','workflow'], 'allow' => true, 'roles' => ['@'], ], ], ] ]; } //This method should be in every controller public function init(){ if (!Yii::$app->user->isGuest){ Yii::$app->language = Yii::$app->user->identity->lang; } } public function actionIndex() { return $this->render('index'); } public function actionWorkflow(){ return $this->render('workflow'); } public function actionGroups(){ return $this->render('groups'); } public function actionTasks(){ return $this->render('tasks'); } }