Multi-tenant update role for a user with same name

could not edit the user (tried to add them to the admin role)

same thing if you try to add a user and assign a role at the same time, doesn't work.

it adds a 'bad' row in the database, assigns the user of the same name in one tenant to the role of a different tenant

I was able to reproduce the problem with the user update - the issue is caused by RemoveFromRolesAsync()/AddToRolesAsync() since there are users with duplicate names. Unfortunately I don't have any solution at the moment, once we find I'll post update here. Exactly because of such issues same user names across tenants were not allowed originally. As a workaround you can assign the roles when adding the user.

UPDATE: Here is how to change Patch method of the ApplicationUsersController:

Thank you.

I'll just wait until the next template update and re run security.