mirror of https://github.com/zulip/zulip.git
settings_users: Only owner can deactivate other owners.
This commit adds the restriction of deactivating owners for admins
by disabling the deactivating button in the UI. Only owners are
allowed to deactivate other owners. The backend part of this is
already implemented in 86b52ef
.
This commit is contained in:
parent
c7a68d60f3
commit
dbd64c4362
|
@ -228,6 +228,7 @@ function human_info(person) {
|
|||
|
||||
info.can_modify = page_params.is_admin;
|
||||
info.is_current_user = people.is_my_user_id(person.user_id);
|
||||
info.cannot_deactivate = info.is_current_user || person.is_owner && !page_params.is_owner;
|
||||
info.display_email = settings_data.email_for_user_settings(person);
|
||||
|
||||
if (info.is_active) {
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<td class="actions">
|
||||
<span class="user-status-settings">
|
||||
{{#if is_active}}
|
||||
<button title="{{t 'Deactivate' }}" class="button rounded small deactivate btn-danger" {{#if is_current_user}}disabled="disabled"{{/if}}>
|
||||
<button title="{{t 'Deactivate' }}" class="button rounded small deactivate btn-danger" {{#if cannot_deactivate}}disabled="disabled"{{/if}}>
|
||||
<i class="fa fa-user-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
{{else}}
|
||||
|
|
Loading…
Reference in New Issue