Remove permission dupliation, fixes accessible_by errors when accessing admin backend

This commit is contained in:
Rohan Mitchell
2013-08-27 10:19:54 +10:00
parent 6a5d819fa6
commit 72136a59ae

View File

@@ -23,7 +23,7 @@ class AbilityDecorator
# Enterprise User can only access orders that they are a distributor for
can [:index, :create], Spree::Order
can [:admin, :index, :read, :create, :update, :fire, :resend], Spree::Order do |order|
can [:admin, :read, :update, :fire, :resend], 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)