I have on table on my database with the column ‘allowedUsers’. This field is TEXT type and filed with the usernames separated with commas.

What I need is to create a CActiveDataProvider to run CListView for users if the user is allowed on above field.

How can I achieve this?

I know its more php/mysql problem than with yii but someone can show me the way?

		$criteriaPrivate=new CDbCriteria;



		$dataProviderPrivate=new CActiveDataProvider('Gallery', array(



				'pageSize'=>Yii::app()->user->getState('pageSize', 50),



				'defaultOrder'=>'weight ASC',




Did you try this?

$criteriaPrivate->addCondition('allowedUsers LIKE :user',array(':user'=>'%'.Yii::app()->user->username).',%'));

Oh dude. Thanks… I got it!