Yii2 RBAC

I want to override RBAC classes. Because i want to implement rbac with branch(multiple branches) level roles . Roles for users changed based on their branch.

So i need to check user_id , role and branch_id.

Is there is any option or how to override those classes?

What do you mean by "branch"?

Isn’t it possible for you to create different roles depending on “branches”?

I’d go for different roles for different branches.