added authorization

This commit is contained in:
Harry Bomrah 2019-03-08 21:47:03 +08:00
parent 0b8baef73b
commit 0e80705437
1 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% can_edit = can_edit_or_delete?(@entries.first.u_table) %>
<% @entries.each do |entry| %> <% @entries.each do |entry| %>
<tr> <tr>
<% @columns.each_with_index do |column, index| %> <% @columns.each_with_index do |column, index| %>
@ -51,7 +52,7 @@
<%= format_date(ce.period_from, column.date_format) %> ~ <%= format_date(ce.period_to, column.date_format) %> <%= format_date(ce.period_from, column.date_format) %> ~ <%= format_date(ce.period_to, column.date_format) %>
<% end %> <% end %>
<% end %> <% end %>
<% if index == 0 %> <% if index == 0 && can_edit %>
<div class="quick-edit"> <div class="quick-edit">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li><a href="<%= admin_universal_table_edit_entry_path(entry) %>"><%= t(:edit) %></a></li> <li><a href="<%= admin_universal_table_edit_entry_path(entry) %>"><%= t(:edit) %></a></li>