[ 'class' => AccessControl::class, 'rules' => [ [ 'allow' => true, 'roles' => ['@'], 'matchCallback' => function ($rule, $action) { return $this->getUserModule() ->getAuthorizationChecker() ->isGrantedAsProducer($this->getUserCurrent()); } ] ], ], ]; } public function actionIndex() { $userModule = $this->getUserModule(); $userProducerManager = $this->getUserProducerManager(); $dataProviderUsersWithNegativeCredit = new ActiveDataProvider([ 'query' => $userModule->queryUsersWithNegativeCredit(), 'sort' => false, 'pagination' => [ 'pageSize' => 30, ], ]); return $this->render('index', [ 'sumUserProducerCredits' => $userProducerManager->sumUserProducerCredits(), 'dataProviderUsersWithNegativeCredit' => $dataProviderUsersWithNegativeCredit ]); } public function actionExportUsers(string $type) { $this->getUserModule()->exportUsersCreditAsCsv($type); } }