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

bug: user with display stock permission can edit product stock #2241

Closed
loicginoux opened this issue Sep 28, 2017 · 4 comments
Closed

bug: user with display stock permission can edit product stock #2241

loicginoux opened this issue Sep 28, 2017 · 4 comments
Labels
changelog:solidus_backend Changes to the solidus_backend gem

Comments

@loicginoux
Copy link
Contributor

loicginoux commented Sep 28, 2017

Steps to reproduce

  • set user permission to display stock and variants, permission sets: StockDisplay and ProductDisplay ), s without manage access.
  • go to backend product stock page -> /admin/products/your-product/stock

Expected behavior

  • icon "edit" should not be visible
  • ajax edit action should not be possible

Actual behavior

  • icon is visible
  • ajax edit action is not possible, "ressource not found" (good!), so at least the backend does not allow the modification

System configuration

Solidus Version: 2.2.1

So basically, that's a matter of hiding the edit icon when user has no stock management permission.
files to look at:

  • solidus_backend-2.2.1/app/views/spree/admin/stock_items/_stock_management.html.erb
  • solidus_backend-2.2.1/app/assets/javascripts/spree/backend/stock_management/index_update_forms.coffee

If this is a valid bug, I could submit a PR.

@BravoSimone
Copy link
Contributor

Hi, I really want to take care of this issue but I can't understand the first step to reproduce the bug, can you provide more detailed instructions?

@loicginoux
Copy link
Contributor Author

Hi, Sorry that may be my bad english :S
You need to set up a role that has only "display stock permission" and "display product". He should not be able to manage neither stock nor product.
Let me know if you have any more questions

@seand7565
Copy link
Contributor

I believe this issue has been solved by #3163

@loicginoux
Copy link
Contributor Author

Thanks for the PR ! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem
Projects
None yet
Development

No branches or pull requests

4 participants