Adjust CanCan ability to reflect that the bulk coop report now runs from the order management engine.

This commit is contained in:
Cillian O'Ruanaidh
2020-06-13 15:41:09 +01:00
parent 3abcb5b23c
commit c1e57fcc12

View File

@@ -185,9 +185,10 @@ class AbilityDecorator
can [:admin, :index, :guide, :import, :save, :save_data, :validate_data, :reset_absent_products], ProductImport::ProductImporter
# Reports page
can [:admin, :index, :customers, :orders_and_distributors, :group_buys, :bulk_coop, :payments,
can [:admin, :index, :customers, :orders_and_distributors, :group_buys, :payments,
:orders_and_fulfillment, :products_and_inventory, :order_cycle_management, :packing],
Spree::Admin::ReportsController
add_bulk_coop_abilities
add_enterprise_fee_summary_abilities
end
@@ -267,6 +268,7 @@ class AbilityDecorator
can [:admin, :index, :customers, :group_buys, :bulk_coop, :sales_tax, :payments,
:orders_and_distributors, :orders_and_fulfillment, :products_and_inventory,
:order_cycle_management, :xero_invoices], Spree::Admin::ReportsController
add_bulk_coop_abilities
add_enterprise_fee_summary_abilities
can [:create], Customer
@@ -291,6 +293,13 @@ class AbilityDecorator
end
end
def add_bulk_coop_abilities
# Reveal the report link in spree/admin/reports#index
can [:bulk_coop], Spree::Admin::ReportsController
# Allow direct access to the report resource
can [:admin, :new, :create], :bulk_coop
end
def add_enterprise_fee_summary_abilities
# Reveal the report link in spree/admin/reports#index
can [:enterprise_fee_summary], Spree::Admin::ReportsController