Using two rbac in yii application

Hello,

In my yii application i’m using rbac extension for authorization. well every thing is ok, so i have a module in this application and i need to define a specific rbac for this module.

so my question is how can I define 2 rbac in yii application :S

:( why I can’t find any reply :S

can any one help with this

  1. You can use database.

  2. You can write some kind of init script that will query each module about what config it is using and will merge it.

can you please give me more details i’m new to yii

my problem is that in yii i only have one config file so how can i gefine 2 authManager

thank you for ur reply

You don’t need to use 2 auth managers. You need to add more rules to a single one.

thank u for your time but my module have an another person table so how can i tell the rbac to read from two tables in the data base?

Hmm… are you using two persons at the same time?

u can say that i have tow table to authenticate, as the project is too big and the data base will contain diiferent type off persons i seperate the persons specfic to the module so the authentication don’t take time

so is the only solution is to merge these two tables?:S

How login/logout works for your two tables? Are you using two separate logins? What is your Yii::app()->user->id when user is logged in?

yes i’m using 2 useridentity/ login forms

Yii::app()->user->getId() contain the id of logged in user

and u can’t log in from the application twice either in the module or in the application

Rules in RBAC are bound to ids returned from Yii::app()->user->id. So if your ids are overlapping you have a problem.

ok so i will merge the 2 table and let the authentication from one table

Thank you :D