Allow user to delete their enterprises' own payment methods

This commit is contained in:
David Cook
2013-08-19 11:31:39 +10:00
parent 4be2fe5fe9
commit 77329b5532

View File

@@ -30,7 +30,7 @@ class AbilityDecorator
#Enterprise User can only access payment methods for their distributors
can [:index, :create], Spree::PaymentMethod
can [:admin, :read, :update, :fire, :resend ], Spree::PaymentMethod do |payment_method|
can [:admin, :read, :update, :fire, :resend, :destroy ], Spree::PaymentMethod do |payment_method|
user.enterprises.include? payment_method.distributor
end