Implement permission checks for adding and deleting line items in issue forms

This commit is contained in:
ricky committed 2026-09-07 21:32:44 -04:00
1 parent 0acf5ffca4
commit 9a9efcbaf9
5 files changed
+40 -29

No files matched your search

+8 -5
View File
@@ -45,11 +45,14 @@
</template>
<p>
<button type="button"
class="icon icon-add"
data-nested-form-add>
<%= l(:button_add) %>
</button>
<% if User.current.allowed_to?(:add_line_items, nil, global: true) %>
<button type="button"
class="icon icon-add"
data-nested-form-add>
<%= l(:button_add) %>
</button>
<% end %>
</p>
<% end %>
@@ -35,13 +35,15 @@
0.00
</td>
<% unless readonly %>
<td class="actions">
<button type="button"
class="icon-only icon-del"
title="<%= l(:label_remove) %>"
data-nested-form-remove>
</button>
</td>
<% if User.current.allowed_to?(:delete_line_items, nil, global: true) %>
<% unless readonly %>
<td class="actions">
<button type="button"
class="icon-only icon-del"
title="<%= l(:label_remove) %>"
data-nested-form-remove>
</button>
</td>
<% end %>
<% end %>
</tr>