_configReader = $configReader; $this->_resourceTreeBuilder = $resourceTreeBuilder; $this->aclDataCache = $aclDataCache ?: ObjectManager::getInstance()->get( \Magento\Framework\Config\CacheInterface::class ); $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); $this->cacheKey = $cacheKey; } /** * {@inheritdoc} */ public function getAclResources() { $tree = $this->aclDataCache->load($this->cacheKey); if ($tree) { return $this->serializer->unserialize($tree); } $aclResourceConfig = $this->_configReader->read(); if (!empty($aclResourceConfig['config']['acl']['resources'])) { $tree = $this->_resourceTreeBuilder->build($aclResourceConfig['config']['acl']['resources']); $this->aclDataCache->save($this->serializer->serialize($tree), $this->cacheKey); return $tree; } return []; } }