Authorize product and not @product

This commit is contained in:
Jean-Baptiste Bellet
2022-07-12 18:49:15 +02:00
parent a80cf37fa6
commit afa40ea82f

View File

@@ -7,7 +7,7 @@ module Api
def update_product_image
product = Spree::Product.find(params[:product_id])
authorize! :update, @product
authorize! :update, product
image = product.images.first || Spree::Image.new(
viewable_id: product.master.id,