I don't know the best approach for access rules of the creator of model in the controller. I usually using like this :
public function accessRules() {
return array(
...
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions' => array('docrop', 'cropimages','upload','setting','updateprivacy','updateuser','changepassword'),
'expression' => array($this,'isCreator'),
),
...
);
}
And then in that controller I'm using this function to check the correct access rules
public function isCreator(){
$hasil=false;
if(isset($_GET['id'])){
$idUser=$_GET['id'];
$hasil=$idUser==Yii::app()->user->id?true:false;
}
return $hasil;
}
And then If I want to create the url I always use the id parameter in that url. Is this the best approach? Or there is an alternative ways that better than this?