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:
Maikel Linke
2023-08-25 09:03:12 +10:00
parent aea0a629ee
commit 02edd829b9

View File

@@ -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