Skip to content

Commit

Permalink
add authentication validation in edit products
Browse files Browse the repository at this point in the history
  • Loading branch information
anamariasosam committed Jul 21, 2016
1 parent 895c544 commit c6a75ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def new

# GET /products/1/edit
def edit
if current_user.id != @product.store_id
flash[:error] = "No tienes permisos para editar este producto"
redirect_to root_url
end
end

# POST /products
Expand Down

0 comments on commit c6a75ee

Please sign in to comment.