Closed michaelarnauts closed 8 years ago
I think name should something like getChildRoles()
.
What do you need it for?
I have a admin-interface to manage the Users, Roles and Permissions where I would like to be able to get the assigned child Roles of a specified Role. This already exists for Permissions (getPermissionsByRole
), but it doesn't for Roles.
OK. Makes sense.
Do you have time for a pull request?
I've added a PR, but you should check to be sure. I haven't tested the code of PhpManager
.
Rbac makes it possible to specify a role that has a parent role. There is however no function
getRolesByRole($roleName)
to get it's children.This function is almost identical to the function
getPermissionsByRole($roleName)
.in
yiisoft/yii2/rbac/DbManager.php
:in
yiisoft/yii2/rbac/ManagerInterface.php
: