Skip to content

Commit

Permalink
Admin::VoucherController check enterprise permission
Browse files Browse the repository at this point in the history
  • Loading branch information
rioug committed May 5, 2023
1 parent 8f04e0d commit 08927e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/admin/vouchers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def create
private

def load_enterprise
@enterprise = Enterprise.find_by(permalink: params[:enterprise_id])
@enterprise = OpenFoodNetwork::Permissions
.new(spree_current_user)
.editable_enterprises
.find_by(permalink: params[:enterprise_id])
end

def permitted_resource_params
Expand Down

0 comments on commit 08927e6

Please sign in to comment.