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

fix(core): Add Permission.ReadProduct to Allow decorator of TaxRateResolver.taxRates #1258

Conversation

vrosa
Copy link
Contributor

@vrosa vrosa commented Dec 6, 2021

As per discussion on Slack:

TaxRateResolver.taxRates() demands ReadTaxRates or ReadCatalog permissions for the tax to be displayed. I would expect ReadProduct to get the job done too.

Agreed, the ReadProduct should be added to the Allow decorator for that field.

TaxRateResolver.taxRates() is ultimately called by VariantPriceDetailComponent, which is used in the product variant view. A role with "read" permissions to Product should be allowed to access that information in the same vein as ReadCatalog.

I have also added a missing async to the function definition as it returns a Promise like the other queries in the same class.

NOTE: I did not update the taxRate resolver in a similar fashion because from what I could gather it's only eventually used as a resolve for the tax-rates/:id path in the Admin UI. That is, unrelated to the issue at hand. However, please let me know if it makes sense to change it as well and I can update this pull request.

@michaelbromley michaelbromley merged commit 5f5f767 into vendure-ecommerce:master Dec 7, 2021
@michaelbromley
Copy link
Member

Thank you!

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