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