32 private $aclDataCache;
52 \
Magento\Framework\Config\ReaderInterface $configReader,
55 Json $serializer =
null,
56 $cacheKey = self::ACL_RESOURCES_CACHE_KEY
58 $this->_configReader = $configReader;
59 $this->_resourceTreeBuilder = $resourceTreeBuilder;
61 \
Magento\Framework\Config\CacheInterface::class
64 $this->cacheKey = $cacheKey;
72 $tree = $this->aclDataCache->load($this->cacheKey);
74 return $this->serializer->unserialize($tree);
76 $aclResourceConfig = $this->_configReader->read();
77 if (!empty($aclResourceConfig[
'config'][
'acl'][
'resources'])) {
78 $tree = $this->_resourceTreeBuilder->build($aclResourceConfig[
'config'][
'acl'][
'resources']);
79 $this->aclDataCache->save($this->serializer->serialize($tree), $this->cacheKey);
__construct(\Magento\Framework\Config\ReaderInterface $configReader, TreeBuilder $resourceTreeBuilder, \Magento\Framework\Acl\Data\CacheInterface $aclDataCache=null, Json $serializer=null, $cacheKey=self::ACL_RESOURCES_CACHE_KEY)
const ACL_RESOURCES_CACHE_KEY