From 46dff6910d2f618222e4213dca55ba68b5b66984 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 6 Feb 2017 17:19:37 -0600 Subject: More backport --- app/views/admin/users/_access_levels.html.haml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'app/views/admin') diff --git a/app/views/admin/users/_access_levels.html.haml b/app/views/admin/users/_access_levels.html.haml index 18fdb1435a9..7855239dfe5 100644 --- a/app/views/admin/users/_access_levels.html.haml +++ b/app/views/admin/users/_access_levels.html.haml @@ -11,18 +11,27 @@ .form-group = f.label :access_level, class: 'control-label' .col-sm-10 - = f.radio_button :access_level, :regular, disabled: (current_user == @user && @user.is_admin?) + - editing_current_user = (current_user == @user) + + = f.radio_button :access_level, :regular, disabled: editing_current_user = label_tag :regular do Regular %p.light Regular users have access to their groups and projects - = f.radio_button :access_level, :admin + + = f.radio_button :access_level, :admin, disabled: editing_current_user = label_tag :admin do Admin %p.light Administrators have access to all groups, projects and users and can manage all features in this installation + - if editing_current_user + %p.light + You cannot remove your own admin rights. .form-group = f.label :external, class: 'control-label' - .col-sm-10= f.check_box :external - .col-sm-10 External users cannot see internal or private projects unless access is explicitly granted. Also, external users cannot create projects or groups. + .col-sm-10 + = f.check_box :external do + External + %p.light + External users cannot see internal or private projects unless access is explicitly granted. Also, external users cannot create projects or groups. -- cgit v1.2.1