/** * Lists all models. */ public function actionIndex() { if (Yii::app()->user->checkAccess('Administrator')) { $this->render('index', array('areas' => Screen::getAreaOptions())); } else { $dataProvider = new CActiveDataProvider('Screen', array('criteria' => array('with' => array('users' => array('condition' => 'user_id = :user_id', 'params' => array(':user_id' => Yii::app()->user->id))), 'together' => true))); $this->render('index', array('dataProvider' => $dataProvider)); } }