Answer the question
In order to leave comments, you need to log in
Role inheritance from permission not working?
RBAC inherited role from permission, assign this role to user, check if he can do "permission" - false response:
role: admin
permission: canAdmin
auth_item_child:
parent | child
--------------+--------
canAdmin | admin
item_name | user_id
--------------+-----------
admin | 1
\Yii::$app->user->can('canAdmin'); // false
Answer the question
In order to leave comments, you need to log in
Through fraud, I realized that it is necessary to inherit not the role from the permission (which is logical), but the permission from the role (which is not at all logical)
Why is that?
After all, usually inheriting - we get the parent's saints, but here it turns out somehow the other way around
role: adminAnd in the table do the opposite.
permission: canAdmin
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question