Commit 61a1d1fc authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Fixed radio buttons conditioning to not allow admins change their own permissions

parent d2f5ee21
...@@ -11,29 +11,22 @@ ...@@ -11,29 +11,22 @@
.form-group .form-group
= f.label :access_level, class: 'control-label' = f.label :access_level, class: 'control-label'
.col-sm-10 .col-sm-10
= f.radio_button :access_level, :regular, checked: true = f.radio_button :access_level, :regular, disabled: (current_user == @user && @user.is_admin?)
= label_tag :regular do = label_tag :regular do
Regular Regular
%p.light %p.light
Regular users have access to their groups and projects Regular users have access to their groups and projects
- if license_allows_auditor_user? - if license_allows_auditor_user?
= f.radio_button :access_level, :auditor = f.radio_button :access_level, :auditor, disabled: (current_user == @user && @user.is_admin?)
= label_tag :auditor do = label_tag :auditor do
Auditor Auditor
%p.light %p.light
Auditors have read-only access to all groups, projects and users Auditors have read-only access to all groups, projects and users
- if current_user == @user = f.radio_button :access_level, :admin
= f.radio_button :access_level, :admin = label_tag :admin do
= label_tag :admin do Admin
Admin %p.light
%p.light Administrators have access to all groups, projects and users and can manage all features in this installation
You cannot remove your own admin rights
- else
= f.radio_button :access_level, :admin
= label_tag :admin do
Admin
%p.light
Administrators have access to all groups, projects and users and can manage all features in this installation
.form-group .form-group
= f.label :external, class: 'control-label' = f.label :external, class: 'control-label'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment