Manager level can not edit Administrator's password and id

This commit is contained in:
San Wai Lwin
2018-04-18 16:57:02 +06:30
parent 859080d4a1
commit 70ec80a1d5
2 changed files with 17 additions and 11 deletions

View File

@@ -7,7 +7,11 @@
<div class="form-inputs p-l-15">
<%= f.input :name %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %>
<% if current_user.role == "administrator" %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %>
<% else %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] != "administrator"},:class=>'form-group' %>
<% end %>
<%= f.input :emp_id, :label => "Employee Numberic ID (*Unique)" %>
<%= f.input :password %>