mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +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
|
#Enterprise User can only access payment methods for their distributors
|
||||||
can [:index, :create], Spree::PaymentMethod
|
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
|
user.enterprises.include? payment_method.distributor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user