Merge branch 'master' into folklabs-producer-emails

This commit is contained in:
Rohan Mitchell
2015-10-29 11:49:24 +11:00
32 changed files with 495 additions and 262 deletions

View File

@@ -142,7 +142,7 @@ class AbilityDecorator
def add_order_management_abilities(user)
# Enterprise User can only access orders that they are a distributor for
can [:index, :create], Spree::Order
can [:read, :update, :fire, :resend], Spree::Order do |order|
can [:read, :update, :fire, :resend, :invoice, :print], Spree::Order do |order|
# We allow editing orders with a nil distributor as this state occurs
# during the order creation process from the admin backend
order.distributor.nil? || user.enterprises.include?(order.distributor)