mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-01 06:41:41 +00:00
Limiting variants loaded into representative template to those a visible to the current user
This commit is contained in:
@@ -15,7 +15,7 @@ r.element :order_cycle, @order_cycle do
|
||||
r.element :receiver_id
|
||||
r.element :incoming
|
||||
|
||||
r.element :variants, Hash[ exchange.variants.map { |v| [v.id, true] } ], {}
|
||||
r.element :variants, Hash[ OpenFoodNetwork::Permissions.new(spree_current_user).visible_variants_within(exchange).map { |v| [v.id, true] } ], {}
|
||||
|
||||
r.list_of :enterprise_fees do |fee|
|
||||
r.element :id
|
||||
|
||||
Reference in New Issue
Block a user