mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Allow to admin vouchers if you know the URL
The generic FeatureToggleConstraint in routing knows about the current user but not about the enterprise to edit. We could create a new custom constraint for routing but it's much easier to handle permissions in the controller. Let's keep routes simple.
This commit is contained in:
@@ -41,9 +41,7 @@ Openfoodnetwork::Application.routes.draw do
|
||||
|
||||
resources :tag_rules, only: [:destroy]
|
||||
|
||||
constraints FeatureToggleConstraint.new(:vouchers) do
|
||||
resources :vouchers, only: [:new, :create]
|
||||
end
|
||||
resources :vouchers, only: [:new, :create]
|
||||
end
|
||||
|
||||
resources :enterprise_relationships
|
||||
|
||||
Reference in New Issue
Block a user