Skip to content

Magento_CatalogPermissions

Magento Modules:

  • Magento_CatalogPermissions
  • Magento_CatalogPermissionsGraphQl

Adobe Commerce Packages

  • magento/module-catalog-permissions
  • magento/module-catalog-permissions-graph-ql

While this module is part of the base Adobe Commerce package, it is also labelled as B2B as it is the backbone of the Shared Catalog functionality: #102

Repository

Note: this repo is only accessible with a Hyvä Enterprise license or as a contributor.

For more details, see: https://www.hyva.io/hyva-enterprise.html.

https://gitlab.hyva.io/hyva-enterprise/commerce/magento2-ee-magento-catalog-permissions

Features

All points are rated according to priority as P1 (critical), P2 (important), P3 (minor).

  • basic - does not break layout/design

Global

  • [P1] Remove search box and advanced search link when current customer cannot access any categories (and therefore products)*

*Managed by a single layout XML file: CATALOGPERMISSIONS_DISABLED_CATALOG_SEARCH.xml. Note: this is not currently overridden in the reset theme, so it works as it stands - we may want to rectify this for consistency.

Cache Navigation Menu By Customer Group

  • [P1] Add customer group ID to the navigation menu blocks cache keys*

*Note: the base catalog permissions module adds this via a plugin on \Magento\Theme\Block\Html\Topmenu - \Magento\CatalogPermissions\Plugin\Theme\Block\Html\Topmenu. We need to replicate this as the navigation menu in Hyvä Themes does not use this block class, given everything is implemented in a ViewModel. We'll need to recreate this plugin on the generic \Magento\Framework\View\Element\Template class and match the block name: topmenu_generic. Switching to use the default block class is not recommended as it would lead to duplicate cache identities being set, among other issues, and could cause unintended side effects with caching.

Note: this is also required to ensure Shared Catalog menus work as expected: #102

Credit to Wout from Youwe for identifying and investigating the possible solutions.

Contributors

Wout Kramer - Youwe

Voting

Use 👍 to cast your vote.

Edited by John Hughes
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information