Getting AuthAssignment name

Hi,

I am using Yiis role and permissions system in my app and I want to get the name of the assignment assigned to a user.

I am using this with no luck …




$auth = new CDbAuthManager;

return $auth->getAuthAssignments($id);



It states …

Fatal error: Call to a member function createCommand() on a non-object in /Applications/MAMP/htdocs/projects/BaseApp/yii/framework/web/auth/CDbAuthManager.php on line 303

Any ideas?

CDbAuthManager class was designed to work as a configurable application component. Do not instantiate it directly in your code.

Ok, any ideas how to get the AuthName? using built in methods in Yii and NOT direct SQL query?

getAuthAssignments() method will work, just call it on the application component.


Yii::app()->authManager->getAuthAssignments($userId);

Advice: use the Rights extension. It is awesome :)