Get All Authitems


Is there a simple to get an array of roles from Yii::app()->authManager ?

something like that Yii::app()->authManager->getAllRoles() (not from specific user)

or I have to fetch all data by sql query ?

I create administrator panel and I want the admin to assign roles to other members

An way is


$command=$connection->createCommand("select name from authitem where type=2");


I don’t want third part - extensions


Why not use Yii::app()->authManager->getRoles() ?

I really forgot that!

Also I think that Yii::app()->authManager->getRoles

requires the user id but this is optional!

(like Yii::app()->authManager->getRoles(Yii::app()->user->id) )

 $roles = Yii::app()->authManager->getRoles();


          foreach ($roles as $key=>$val) {

             $list[] = $key;


thanks Ronald! :)