diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-01-11 14:54:49 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-01-11 14:54:49 +0100 |
commit | 34c8ca286aeeb6731d7b7d0cba3430564c2b2cd5 (patch) | |
tree | 3a321a073dd84a1a32a915d06629eb5f6a19cffd | |
parent | 12dbd0a4137546026a7a1f606510627f262d6dc0 (diff) | |
download | gitlab-ce-34c8ca286aeeb6731d7b7d0cba3430564c2b2cd5.tar.gz |
Fix for edit user as admin
* It fixes an issue where you where able to remove your own
admin rights. This would result in a 404 error. fixes: #2283
* It fixes an issue where you would be able to block your own
account on the edit page. This fix makes the behaviour the same
as on the admin/users overview page
-rw-r--r-- | app/views/admin/users/_form.html.haml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 4e8024a80cc..98bf65bc420 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -56,8 +56,12 @@ .form-group = f.label :admin, class: 'control-label' - .col-sm-10= f.check_box :admin - - unless @user.new_record? + - if current_user == @user + .col-sm-10= f.check_box :admin, disabled: true + .col-sm-10 You cannot remove your own admin rights + - else + .col-sm-10= f.check_box :admin + - unless @user.new_record? || current_user == @user .alert.alert-danger - if @user.blocked? %p This user is blocked and is not able to login to GitLab |