[ 'class' => AccessControl::class, 'rules' => [ [ 'allow' => true, 'roles' => ['@'], 'matchCallback' => function ($rule, $action) { return $this->getUserModule() ->getAuthorizationChecker() ->isGrantedAsProducer($this->getUserCurrent()); } ] ], ], ]; } /** * Liste les versions d'Opendistrib */ public function actionIndex() { $producerModule = $this->getProducerModule(); $versionsArray = Souke::getVersions(); $versionsRenderArray = []; foreach ($versionsArray as $version) { $versionsRenderArray[$version] = [ 'version' => $version, 'content' => $this->renderFile('@common/versions/' . $version . '.php', [ 'userCurrent' => $this->getUserCurrent() ]) ]; } $producerModule->updateOpendistribVersion($this->getProducerCurrent()); return $this->render('index', [ 'versionsArray' => $versionsRenderArray ]); } public function actionUpdateDisplayMessageNewSoukeVersion(int $displayMessage) { $producer = $this->getProducerCurrent(); $producer->option_display_message_new_opendistrib_version = (bool) $displayMessage; $producer->save(); return $this->redirect('index'); } }