Authorization Manager with Role-Based Access Control on DB


I don't understand very well the Authorization Manager (RBAC) with a DB.

Yii provides two types of authorization managers: CPhpAuthManager and CDbAuthManager.

If i understand, for using CDbAuthManager is necessary :

  1. create on DB 3 tables: AuthAssignment, AuthItem and AuthItemChild. (see /yii/framework/web/auth/schema.sql) 

  2. Defined authorization hierarchy on DB

  3. modify main.php with this




  1. For Access Checking example:





But my application doesn't work.

If I use this for checking my authManager



I received

CPhpAuthManager Object ( [authFile] => /var/www/yii-read-only/demos/testauth/protected/data/auth.php [_items:private] => Array ( ) [_children:private] => Array ( ) [_assignments:private] => Array ( ) [_initialized:private] => 1 [_e:private] => )


I don't understand.

Is my application using CPhpAuthManager or CDbAuthManager ?

Could you help me to find my error ? 



Sorry, there's a typo in the Guide: you should change 'authComponent' to 'authManager'. Fixed.

I would like to thank you for your very quick response to my problem