From 77329b5532bb776a688dd6645cee50072a2a7371 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 19 Aug 2013 11:31:39 +1000 Subject: [PATCH] Allow user to delete their enterprises' own payment methods --- app/models/spree/ability_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/ability_decorator.rb b/app/models/spree/ability_decorator.rb index 34bd9679a4..eae10efb66 100644 --- a/app/models/spree/ability_decorator.rb +++ b/app/models/spree/ability_decorator.rb @@ -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