Using default action actionAdmin in controllers for both admin and non-admin users?

Hi everyone,

The generated actionAdmin works only if you are an admin, but I want to use it for non-admin user too.

So what I need help in is how to get the model depending on the role:

admin => should see all the real estates entries

non-admin => should only see his own real estates entries

The actionAdmin is:




public function actionAdmin()  

{ 

        $model=new RealEstate('search'); 

        $model->unsetAttributes();  // clear any default values 

        if(isset($_GET['RealEstate'])) 

            $model->attributes=$_GET['RealEstate']; 

 

        $this->render('admin',array('model'=>$model,));          

}



You already posted that question - http://www.yiiframework.com/forum/index.php?/topic/18801-

It’s a very bad practice to post the same question again…

Mdomba cut me a slack, Iam new to this forum and was not sure to which forum-category to post the questions. After careful inspection the General Discussion seems where I should have posted them in the first place. I asure you this won’t happen again.