18
18
use Magento \Framework \UrlInterface ;
19
19
use Magento \Framework \Stdlib \ArrayManager ;
20
20
use Magento \Framework \AuthorizationInterface ;
21
+ use Magento \Backend \Model \Auth \Session ;
21
22
22
23
/**
23
24
* Data provider for categories field of product page
@@ -86,12 +87,18 @@ class Categories extends AbstractModifier
86
87
*/
87
88
private $ authorization ;
88
89
90
+ /**
91
+ * @var Session
92
+ */
93
+ private $ session ;
94
+
89
95
/**
90
96
* @param LocatorInterface $locator
91
97
* @param CategoryCollectionFactory $categoryCollectionFactory
92
98
* @param DbHelper $dbHelper
93
99
* @param UrlInterface $urlBuilder
94
100
* @param ArrayManager $arrayManager
101
+ * @param Session $session
95
102
* @param SerializerInterface $serializer
96
103
* @param AuthorizationInterface $authorization
97
104
*/
@@ -101,6 +108,7 @@ public function __construct(
101
108
DbHelper $ dbHelper ,
102
109
UrlInterface $ urlBuilder ,
103
110
ArrayManager $ arrayManager ,
111
+ Session $ session ,
104
112
SerializerInterface $ serializer = null ,
105
113
AuthorizationInterface $ authorization = null
106
114
) {
@@ -111,6 +119,7 @@ public function __construct(
111
119
$ this ->arrayManager = $ arrayManager ;
112
120
$ this ->serializer = $ serializer ?: ObjectManager::getInstance ()->get (SerializerInterface::class);
113
121
$ this ->authorization = $ authorization ?: ObjectManager::getInstance ()->get (AuthorizationInterface::class);
122
+ $ this ->session = $ session ;
114
123
}
115
124
116
125
/**
@@ -373,6 +382,7 @@ private function getCategoriesTreeCacheId(int $storeId, string $filter = '') : s
373
382
{
374
383
return self ::CATEGORY_TREE_ID
375
384
. '_ ' . (string ) $ storeId
385
+ . '_ ' . $ this ->session ->getUser ()->getAclRole ()
376
386
. '_ ' . $ filter ;
377
387
}
378
388
0 commit comments