1
2
3
4
$auth=Yii::app()->authManager;
$role=$auth->createRole('user');
$role=$auth->createRole('admin');
$role=$auth->addChild('user');