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