I'm using yii2 role based access control (RBAC) system. I defined roles and permissions, defined rules, assigned roles to users. Everything works fine.
but i want to update assigned roles to users. For example:
Yii::$app->authManager->assign('admin', '11');
Here i did user id 11 admin. Now i want to update and change. I want to make this user manager.
When i try:
Yii::$app->authManager->assign('manager', '11');
This user have admin + manager. I just want to update this user role admin to manager.
How can i do this?
first you revoke() or revokeAll() user role:
Remove current role 'admin':
and again update new role to user: