pundit: convert bulk update requests to pundit.

This commit is contained in:
evazion
2020-03-17 18:32:29 -05:00
parent b83c612246
commit 79a365abe0
6 changed files with 76 additions and 73 deletions

View File

@@ -1,11 +1,11 @@
<%# bur %>
<% if bur.approvable?(CurrentUser.user) %>
<% if policy(bur).approve? %>
<%= link_to "Approve", approve_bulk_update_request_path(bur), remote: true, method: :post, "data-confirm": "Are you sure you want to approve this bulk update request?" %> |
<% end %>
<% if bur.rejectable?(CurrentUser.user) %>
<% if policy(bur).destroy? %>
<%= link_to "Reject", bur, remote: true, method: :delete, "data-confirm": "Are you sure you want to reject this bulk update request?" %> |
<% end %>
<% if bur.editable?(CurrentUser.user) %>
<% if policy(bur).update? %>
<%= link_to "Edit", edit_bulk_update_request_path(bur), :"data-shortcut" => "e" %>
<% end %>

View File

@@ -38,7 +38,7 @@
</div>
<% end %>
<% if @bulk_update_request.persisted? && CurrentUser.is_admin? %>
<% if @bulk_update_request.persisted? && policy(@bulk_update_request).can_update_forum? %>
<%= f.input :forum_topic_id %>
<%= f.input :forum_post_id %>
<% end %>