How to get users of a specefic role in Yii2 and DbManager in RBAC?
Please introduce some API for user management and role management.
I searched and read Yii2 guide but I didn't find any solution.
How to get users of a specefic role in Yii2 and DbManager in RBAC?
Please introduce some API for user management and role management.
I searched and read Yii2 guide but I didn't find any solution.
I used @Manquer guide and wrote this function:
Maybe useful for someone.
I wrote this function which can be added to an User class.
Since Yii version 2.0.7,
DbManager
andManagerInterface
which it implements havegetUserIdsByRole($roleName)
which does what you want without custom code.