When a custom access rules are implemented for product variations using hook_ENTITY_TYPE_access(), the product selection list of variations show up the variations even when do not pass access.

Comments

citlacom created an issue. See original summary.

citlacom’s picture

StatusFileSize
new846 bytes
citlacom’s picture

Status: Active » Needs review
bojanz’s picture

Status: Needs review » Needs work

I'm fine with doing this filtering in loadEnabled(). Let's do it after the event is fired though, that way if the event ends up adding variations (which it shouldn't, but you never know), we are still access-covered.

We also need to expand ProductVariationStorageTest::testLoadEnabled() to test for this.

mglaman’s picture

Assigned: Unassigned » mglaman

Updated based on #4.

mglaman’s picture

Issue tags: +Needs tests
StatusFileSize
new1.13 KB

Keeping at needs work because of tests.

mglaman’s picture

Title: ProductVariationStorage::loadEnabled do not respect product variations access rules » ProductVariationStorage::loadEnabled, loadFromContext do not respect product variations access rules
StatusFileSize
new1.59 KB

We need to check in loadFromContext as well that the variation from the URL query is allowed.

mglaman’s picture

  • bojanz committed 2b88df4 on 8.x-2.x authored by mglaman
    Issue #2741295 by mglaman, citlacom: ProductVariationStorage::...
bojanz’s picture

Status: Needs work » Fixed

Thanks, everyone.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.