_aclFactory = $aclFactory; $this->_loaderPool = [$roleLoader, $resourceLoader, $ruleLoader]; } /** * Build Access Control List * * @return \Magento\Framework\Acl * @throws \LogicException */ public function getAcl() { if ($this->_acl instanceof \Magento\Framework\Acl) { return $this->_acl; } try { $this->_acl = $this->_aclFactory->create(); foreach ($this->_loaderPool as $loader) { $loader->populateAcl($this->_acl); } } catch (\Exception $e) { throw new \LogicException('Could not create an acl object: ' . $e->getMessage()); } return $this->_acl; } /** * Remove cached ACL instance. * * @return $this * @since 101.0.0 */ public function resetRuntimeAcl() { $this->_acl = null; return $this; } }