Commit 2c50252417bcf3ddd42d6f740feab17ef67ae0c5
Exists in
spb-stable
and in
3 other branches
Merge pull request #6025 from jvanbaarsen/fix-for-admin-user-edit
Fix for edit user as admin
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
app/views/admin/users/_form.html.haml
... | ... | @@ -56,8 +56,12 @@ |
56 | 56 | |
57 | 57 | .form-group |
58 | 58 | = f.label :admin, class: 'control-label' |
59 | - .col-sm-10= f.check_box :admin | |
60 | - - unless @user.new_record? | |
59 | + - if current_user == @user | |
60 | + .col-sm-10= f.check_box :admin, disabled: true | |
61 | + .col-sm-10 You cannot remove your own admin rights | |
62 | + - else | |
63 | + .col-sm-10= f.check_box :admin | |
64 | + - unless @user.new_record? || current_user == @user | |
61 | 65 | .alert.alert-danger |
62 | 66 | - if @user.blocked? |
63 | 67 | %p This user is blocked and is not able to login to GitLab | ... | ... |