/** * Lists all AuthItemChild models. * @return mixed */ public function actionIndex() { if (Yii::$app->user->can('watcher')) { $searchModel = new AuthItemChildSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); } else { throw new ForbiddenHttpException(); } }
/** * @return string */ public function actionIndex() { $searchModel = new AuthItemChildSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }