Merge branch 'master' into xero-report

This commit is contained in:
Rohan Mitchell
2015-05-15 16:57:11 +10:00
3 changed files with 7 additions and 4 deletions

View File

@@ -120,7 +120,7 @@ class AbilityDecorator
can [:admin, :index, :read, :create, :edit], Spree::Classification
# Reports page
can [:admin, :index, :customers, :orders_and_distributors, :group_buys, :bulk_coop, :payments, :orders_and_fulfillment, :products_and_inventory], :report
can [:admin, :index, :customers, :orders_and_distributors, :group_buys, :bulk_coop, :payments, :orders_and_fulfillment, :products_and_inventory, :order_cycle_management], :report
end
def add_order_cycle_management_abilities(user)

View File

@@ -20,6 +20,10 @@
include_blank: true)
%br
%br
= label_tag nil, "Report Type: "
= select_tag(:report_type, options_for_select(@report_types, @report_type))
%br
%br
= check_box_tag :csv
= label_tag :csv, "Download as csv"
%br
@@ -41,4 +45,3 @@
- if @report.table.empty?
%tr
%td{:colspan => "2"}= t(:none)

View File

@@ -213,7 +213,7 @@ module Spree
end
it "should be able to read some reports" do
should have_ability([:admin, :index, :customers, :bulk_coop, :orders_and_fulfillment, :products_and_inventory], for: :report)
should have_ability([:admin, :index, :customers, :bulk_coop, :orders_and_fulfillment, :products_and_inventory, :order_cycle_management], for: :report)
end
it "should not be able to read other reports" do
@@ -400,7 +400,7 @@ module Spree
end
it "should be able to read some reports" do
should have_ability([:admin, :index, :customers, :sales_tax, :group_buys, :bulk_coop, :payments, :orders_and_distributors, :orders_and_fulfillment, :products_and_inventory], for: :report)
should have_ability([:admin, :index, :customers, :sales_tax, :group_buys, :bulk_coop, :payments, :orders_and_distributors, :orders_and_fulfillment, :products_and_inventory, :order_cycle_management], for: :report)
end
it "should not be able to read other reports" do