Definition at line 13 of file Role.php.
◆ __construct()
- Parameters
-
\Magento\Authorization\Model\Acl\Role\GroupFactory | $groupFactory | |
\Magento\Authorization\Model\Acl\Role\UserFactory | $roleFactory | |
\Magento\Framework\App\ResourceConnection | $resource | |
\Magento\Framework\Acl\Data\CacheInterface | $aclDataCache | |
Json | $serializer | |
string | $cacheKey | |
Definition at line 58 of file Role.php.
68 $this->_roleFactory = $roleFactory;
70 \
Magento\Framework\Acl\Data\CacheInterface::class
73 $this->cacheKey = $cacheKey;
◆ populateAcl()
Populate ACL with roles from external storage
- Parameters
-
\Magento\Framework\Acl | $acl | |
- Returns
- void
Definition at line 82 of file Role.php.
84 foreach ($this->getRolesArray() as $role) {
85 $parent = $role[
'parent_id'] > 0 ? $role[
'parent_id'] :
null;
86 switch ($role[
'role_type']) {
87 case RoleGroup::ROLE_TYPE:
88 $acl->addRole($this->_groupFactory->create([
'roleId' => $role[
'role_id']]), $parent);
91 case RoleUser::ROLE_TYPE:
92 if (!$acl->hasRole($role[
'role_id'])) {
93 $acl->addRole($this->_roleFactory->create([
'roleId' => $role[
'role_id']]), $parent);
95 $acl->addRoleParent($role[
'role_id'], $parent);
◆ $_groupFactory
◆ $_resource
◆ $_roleFactory
◆ ACL_ROLES_CACHE_KEY
const ACL_ROLES_CACHE_KEY = 'authorization_role_cached_data' |
Cache key for ACL roles cache
Definition at line 18 of file Role.php.
The documentation for this class was generated from the following file:
- vendor/magento/module-authorization/Model/Acl/Loader/Role.php