mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Remove permission dupliation, fixes accessible_by errors when accessing admin backend
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user