[ 'class' => AccessControl::class, 'only' => ['search'], 'rules' => [ [ 'actions' => ['search'], 'allow' => true, 'roles' => ['userListViewer'] ] ] ], 'verbs' => [ 'class' => VerbFilter::class, 'actions' => [ 'search' => ['POST'], ] ] ]; } public function actionSearch(Request $request) { if (!$request->isPost) { return false; } if (Yii::$app->user->id === null) { return false; } $search = new UserSearch(); $provider = $search->search($request->post()); return $provider->query->all(); } }