mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-18 19:36:48 +00:00
Allow user to delete their enterprises' own payment methods
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user