Needs review
Project:
Commerce Core
Version:
3.x-dev
Component:
Product
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2026 at 00:55 UTC
Updated:
6 Nov 2026 at 10:59 UTC
Jump to comment: Most recent
After the security fixes in 3.3.13 I can no longer use filters on product variations in the JSON:API even if the account has permission to view unpublished variations (via the 'manage {bundle} commerce_product_variation' permission).
The account can still view the unpublished variations via the JSON:API. But if it uses a filter to search variations then any unpublished ones are omitted from the list.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
jsacksick commentedThanks for the report, confirmed.
Since 3.3.13, entity queries for product variations only match the variations the current user can view (
CommerceProductHooks::queryCommerceProductVariationAccessAlter(), which followsProductVariationAccessControlHandler). However,hook_jsonapi_commerce_product_variation_filter_access()`still only granted filtering among published variations (`view commerce_product`) and among own variations (`view own unpublished commerce_product`). As soon as afilteris present, JSON:API restricts the query further using those grants, so unpublished variations were dropped even for users with themanage {bundle} commerce_product_variationpermission, who can view them.Since variations the user can't view are already excluded at the query level, the MR grants filtering among all variations (same as for orders), so filtered and unfiltered collections now return the same variations. Tests cover filtering unpublished variations with and without the manage permission, and filtering the variations of the user's own unpublished products.
Comment #5
jsacksick commented