CDbAuthManager, checkDefaultRoles()

I am not sure if this excerpt from Yii 1.0.3 CDbAuthManager class has some defect.

It doesn't use param $userId and a strange $condition variable is count when it was ot set.

        protected function checkDefaultRoles($itemName,$userId,$params)



                foreach($this->defaultRoles as $role)








                        $condition='name='.implode(' OR name=',$names);


                        $condition='name IN ('.implode(', ',$names).')';

                $sql="SELECT name, type, description, bizrule, data FROM {$this->itemTable} WHERE $condition";



                foreach($rows as $row)


                        $item=new CAuthItem($this,$row['name'],$row['type'],$row['description'],$row['bizrule'],unserialize($row['data']));


                                return true;


                return false;


Also, I notice this code from Definitive guide pass $bizRule incorrectly:

$bizRule='return Yii::app()->user->isGuest;';


$bizRule should be the 3rd parameter

Thank you very much! Just checked in the fix.

That's great. Thank you very much.

Also, do you consider to create a web-based authItem management system ? something like phpGACL does

Yes, we do, but not in the near future. Perhaps in 1.1 release.