Get All Authitems

Hi

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


$connection=Yii::app()->db; 

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

$dataReader=$command->queryAll();

I don’t want third part - extensions

Thanks

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();

          $list=array();

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

             $list[] = $key;

          }

thanks Ronald! :)