authManager role problem

I am trying to develop an RBAC system for the application I’m developing and I’m having some trouble. I have created roles and assigned a user to a role.

When I go:


Yii::app()->user->checkAccess('some_role'));

It works correctly, displaying true if the user is in the role, and false if they are not.

However, when I go:


Yii::app()->authManager->getRoles(1);

(assuming 1 is the UID of the user) I just get a blank array.

I have checked the getId function is returning the right ID in my UserAuth class.

Anyone have any idea what’s going on?

Heve you seen

http://www.yiiframework.com/forum/index.php?/topic/6131-how-to-not-cache-rbac-checkaccess-results/