Fix updating member with custom role after license downgrade
What does this MR do and why?
When a customer has Ultimate license they can use Custom roles. But when they downgrade custom roles feature is not available anymore.
This MR fixed the bug that after downgrade it is not possible to change static role of a user who had custom role assigned.
Possible follow-ups
- once a license is downgraded or expires we could change roles of all members to the custom role base access level
References
How to set up and validate locally
- Create a custom role (for self-managed instance in Admin area -> Settings -> Roles and Permissions, http://gdk.test:3000/admin/application_settings/roles_and_permissions)
- Go to group or project members page
- Assign this custom role to a user
- Now remove the License from your instance, eg. in Rails console (
License.delete_all), make sure you have your licensed key saved somewhere else so that you can add it again - Restart the instance to make sure it took effect (I am not sure this step is needed, but I had access to the licensed features even after the License removal and
gdk restartfixed that) - Go back to the group / project members page
- Now assign a static role to the user(s) with the custom role and it should work
- Reload the page and make sure the change was really saved
Don't forget to add license to your GitLab instance after verification or you might get confused in few days (personal experience
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #523883 (closed)
Edited by Jarka Košanová