From 34c8ca286aeeb6731d7b7d0cba3430564c2b2cd5 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Sat, 11 Jan 2014 14:54:49 +0100 Subject: [PATCH] Fix for edit user as admin --- app/views/admin/users/_form.html.haml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 4e8024a..98bf65b 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 -- libgit2 0.21.2