Role-Based Access Control Storage

hi every body

Role-Based Access Control provide 2 way for storing role data : database and file system

take a look at this assignment code


$auth->assign('reader','readerA');

reader is the role

my question is :

readerA is the user unique id or user category?

according to the yii api document. readerA should be a user id.

If its relevant, and possible, why reinvent the wheel? If the biz logic is for an administrative interface (and not related to app biz logic), consider using ready made GUI interfaces to control your auth items assignments. I use RBAM and happy about it.

thanks for replay

if readerA is user id then if i have 1,2,3,4 users ids with same permission level how i could assign them to

the role ?

is this assignment will be saved once also or i need to perform this assignment every time i need

to assign a role to a user?

I’m not sure I understood you… .

You assign roles to users with either the API method for it (which I never used and don’t recall its name). You do not need to do this assignment of a role to a user over and over. After you assign the role to the user you can manipulate the ‘auth items’ (operations) that are included in that role, and that will be effective immediately across the system.

When new user comes along and require the same permissions you simply assign the relevant role to him/her as well.