user_profile: Disable role dropdown for only owner.

This commit adds code to disable the role dropdown
when an owner is editing their own profile and they
are the only owner in the organization and a tooltip
is shown mentioning that.

We already keep the role dropdown disabled when an
admin user was managing an owner's profile.

Fixes #34830.
This commit is contained in:
whilstsomebody
2025-09-04 23:32:37 +05:30
committed by Tim Abbott
parent e10f1ef260
commit 2378d7700b
2 changed files with 16 additions and 2 deletions

View File

@@ -20,7 +20,7 @@
<label for="user-role-select" class="modal-field-label">{{t 'User role' }}
{{> ../help_link_widget link="/help/user-roles" }}
</label>
<select name="user-role-select" class="bootstrap-focus-style modal_select" id="user-role-select" data-setting-widget-type="number" {{#if disable_role_dropdown}}disabled{{/if}}>
<select name="user-role-select" class="bootstrap-focus-style modal_select" id="user-role-select" data-setting-widget-type="number">
{{> dropdown_options_widget option_values=user_role_values}}
</select>
</div>