Merge pull request #5197 from nonamethanks/fix-bur-links
BURs: don't allow edits to approved scripts
This commit is contained in:
@@ -6,7 +6,7 @@ class BulkUpdateRequestPolicy < ApplicationPolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update?
|
def update?
|
||||||
unbanned? && (user.is_admin? || record.user_id == user.id)
|
unbanned? && !record.is_approved? && (user.is_admin? || record.user_id == user.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def approve?
|
def approve?
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<%# bur %>
|
<%# bur %>
|
||||||
|
|
||||||
<%= link_to_if policy(bur).approve?, "Approve", approve_bulk_update_request_path(bur), remote: true, method: :post, "data-confirm": "Are you sure you want to approve this bulk update request?" %> |
|
<%= link_to_if policy(bur).approve?, "Approve", approve_bulk_update_request_path(bur), remote: true, method: :post, "data-confirm": "Are you sure you want to approve this bulk update request?" %>
|
||||||
<% if policy(bur).destroy? %>
|
<% 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?" %> |
|
| <%= link_to "Reject", bur, remote: true, method: :delete, "data-confirm": "Are you sure you want to reject this bulk update request?" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if policy(bur).update? %>
|
<% if policy(bur).update? %>
|
||||||
<%= link_to "Edit", edit_bulk_update_request_path(bur), :"data-shortcut" => "e" %>
|
| <%= link_to "Edit", edit_bulk_update_request_path(bur), :"data-shortcut" => "e" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user