In my RBAC system I have

  • ‘r1’,‘r2’ and ‘r3’ for roles

  • ‘p1’ , ‘p2’ , ‘p3’ , … , ‘p100’ for permissions

addChild(r1, ‘p1’…‘p10’);

addChild(r2, ‘p1’…‘p20’);

addChild(r3, ‘p1’…‘p100’);

My problem is If I assign(r1, 2) , the user #2 can access ‘p1’…‘p10’ , but sometime I need to add extra permission for special user without adding new role , for example I must assign user #2 to ‘r1’ role and allow ‘p50’ permission too only for this user

How can I do this using yii\rbac\DbManager class?

I dont know it is best for you but,Create new role which have both permissions.and assign to user.