stucked in action index

hi i have this currently to show only the albums of the user id provided to index

public function actionIndex($id)


		$dataProvider=new CActiveDataProvider('Albums',array('criteria'=>array('condition'=>'user_id='.$id)));





but what i want is that

if one user is trying to view the index of albums of another user then it should only see the public albums not all the albums that match the id provided

i can’t figure out how to do it with the dataProvider as it returns all the records according to condition.

can any one tell me how to filter the result form dataProvider and render it then based on the situation mentioned above ???

figured it out thanx

It would be really helpful if you explained how you solved it. :)