Use two different tables for login with different RBAC

Hi,

I want to use two different tables for login. One for users and one for staff login. Currently there is only one table ‘users’ and I am using yii’s built in RBAC and everything is working fine. Now I want to add the second table ‘staff’ for login without RBAC. So during login it will first check for the username in ‘users’ table and if it is not there then it will check in the ‘staff’ table and then check the password. I was able to do the logic for login successfully. But now the problem is RBAC. The “AuthAssignment” table has userid as foreign key of ‘users’ table, so if the staff id has a corresponding id in ‘users’ table then the system will provide access according to the role of the ‘users’ table. How can I avoid it if login is from staff table. Is it possible to give different role for ‘staff’ table or is it possible to not use role for ‘staff’ table.

Please help. Thanks in advance.

Sounds a bit over complicated. Why don’t you simply add “staff” role to RBAC?


        

	'components'=>array(

'authManager'=>array(

            'class'=>'CDbAuthManager',

            'connectionID'=>'db',

	        'itemTable'=>'tbl_auth_item',

	        'itemChildTable'=>'tbl_auth_item_child',

	        'assignmentTable'=>'tbl_auth_assignment',

        ),


)

Could you please explain.

You can change RBAC table names if you want. http://www.yiiframework.com/forum/index.php/topic/9903-rename-rbac-tables/

Thanks for the reply. But that is not the thing I want.