We don't need to update backend for this, I would prefer fetching target user rights in frontend first, and sending these rights in the user creation request.
This would keep backend code simpler.
Moreover, UI should either allow to copy user rights OR specify manual rights. Right now both are displayed, and if I select a user to copy AND specify manual rights, only manual rights are taken.
There is still some issues with the form as it is:
If I first set custom rights for a tenant, and then select a user to copy right for, tenant appears twice in the form with different right, which doesn't make sense. As indicated in my previous comment, I think the best way to avoid this is to either display "user to copy" with a single user select OR a complete right form (to set rights manually). For now it's not a big deal if we can't see / change rights of the selected user while copying right.
Reselecting the same user in select result in an error:
This modification breaks the UI (an error is displayed) if invitation mode is "mail" instead of "request response", I dont understand why this change was needed.
We don't need to update backend for this, I would prefer fetching target user rights in frontend first, and sending these rights in the user creation request. This would keep backend code simpler.
Moreover, UI should either allow to copy user rights OR specify manual rights. Right now both are displayed, and if I select a user to copy AND specify manual rights, only manual rights are taken.