fix(core): Add Permission.ReadProduct to Allow decorator of TaxRateResolver.taxRates #1258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per discussion on Slack:
TaxRateResolver.taxRates()
is ultimately called byVariantPriceDetailComponent
, 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 asReadCatalog
.I have also added a missing
async
to the function definition as it returns aPromise
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 aresolve
for thetax-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.