Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add authentication validation in edit products #52

Merged
merged 2 commits into from
Jul 23, 2016

Conversation

anamariasosam
Copy link
Owner

Este feature añade la validación para solo el usuario dueño del producto lo pueda editar. Para testearlo ingresar desde una cuenta diferente al /products/:id/edit si no eres dueño de ese producto no puedes editarlo

@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listo! ya la hago @alexrqs 😄

@anamariasosam anamariasosam merged commit 801083d into master Jul 23, 2016
@alexrqs alexrqs deleted the hotfix/edit_product_permissions branch August 23, 2016 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants