Closed karolselak closed 4 years ago
And in general, this case could also get more civilized when in attempt of adding a group role to non-group user whole non-group array would be converted to the __global_roles__
(or else named) field in the new roles object, without throwing the error.
I think this was an issue with v1.0 only. Use v2.0.
Fortunately I found out how to deal with it manually, but I still think that's a bug. After removing all non-group roles with
removeUsersFromRoles
method emptyroles
array still lasts in database, so if I want add some group role, I get error "Can't mix grouped and non-grouped roles for same user" and I'm forced to remove this field manually first.All issue is to add one small check if removing element is the last one for this user.