/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Authorization.php
49 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Magento Authorization component. Can be used to add authorization facility to any application * * Copyright 2014 Adobe * All Rights Reserved. */ namespace Magento\Framework; class Authorization implements \Magento\Framework\AuthorizationInterface { /** * ACL policy * * @var \Magento\Framework\Authorization\PolicyInterface */ protected $_aclPolicy; /** * ACL role locator * * @var \Magento\Framework\Authorization\RoleLocatorInterface */ protected $_aclRoleLocator; /** * @param \Magento\Framework\Authorization\PolicyInterface $aclPolicy * @param \Magento\Framework\Authorization\RoleLocatorInterface $roleLocator */ public function __construct( \Magento\Framework\Authorization\PolicyInterface $aclPolicy, \Magento\Framework\Authorization\RoleLocatorInterface $roleLocator ) { $this->_aclPolicy = $aclPolicy; $this->_aclRoleLocator = $roleLocator; } /** * Check current user permission on resource and privilege * * @param string $resource * @param string $privilege * @return boolean */ public function isAllowed($resource, $privilege = null) { return $this->_aclPolicy->isAllowed($this->_aclRoleLocator->getAclRoleId(), $resource, $privilege); } }