Skip to content

Commit 54a11eb

Browse files
Add ACL role ID to category tree cache id
1 parent 8ec21ff commit 54a11eb

File tree

1 file changed

+10
-0
lines changed
  • app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier

1 file changed

+10
-0
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Magento\Framework\UrlInterface;
1919
use Magento\Framework\Stdlib\ArrayManager;
2020
use Magento\Framework\AuthorizationInterface;
21+
use Magento\Backend\Model\Auth\Session;
2122

2223
/**
2324
* Data provider for categories field of product page
@@ -86,12 +87,18 @@ class Categories extends AbstractModifier
8687
*/
8788
private $authorization;
8889

90+
/**
91+
* @var Session
92+
*/
93+
private $session;
94+
8995
/**
9096
* @param LocatorInterface $locator
9197
* @param CategoryCollectionFactory $categoryCollectionFactory
9298
* @param DbHelper $dbHelper
9399
* @param UrlInterface $urlBuilder
94100
* @param ArrayManager $arrayManager
101+
* @param Session $session
95102
* @param SerializerInterface $serializer
96103
* @param AuthorizationInterface $authorization
97104
*/
@@ -101,6 +108,7 @@ public function __construct(
101108
DbHelper $dbHelper,
102109
UrlInterface $urlBuilder,
103110
ArrayManager $arrayManager,
111+
Session $session,
104112
SerializerInterface $serializer = null,
105113
AuthorizationInterface $authorization = null
106114
) {
@@ -111,6 +119,7 @@ public function __construct(
111119
$this->arrayManager = $arrayManager;
112120
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class);
113121
$this->authorization = $authorization ?: ObjectManager::getInstance()->get(AuthorizationInterface::class);
122+
$this->session = $session;
114123
}
115124

116125
/**
@@ -373,6 +382,7 @@ private function getCategoriesTreeCacheId(int $storeId, string $filter = '') : s
373382
{
374383
return self::CATEGORY_TREE_ID
375384
. '_' . (string) $storeId
385+
. '_' . $this->session->getUser()->getAclRole()
376386
. '_' . $filter;
377387
}
378388

0 commit comments

Comments
 (0)