[ 'class' => AccessControl::class, 'rules' => [ [ 'allow' => true, 'roles' => ['@'], 'matchCallback' => function ($rule, $action) { return $this->getUserModule() ->getAuthorizationChecker() ->isGrantedAsAdministrator($this->getUserCurrent()); } ] ], ], ]; } public function actionIndex() { $settingModule = $this->getSettingModule(); $model = new AdminSettingsForm(); if($model->load(\Yii::$app->request->post()) && $model->validate()) { foreach($settingModule->getAdminSettingDefinition()->getSettingDetailsFlat() as $settingDetail) { $settingModule->getAdminSettingBag()->set($settingDetail->getName(), $model->{$settingDetail->getName()}); } } return $this->render('index', [ 'model' => $model ]); } }