_coreRegistry = $coreRegistry; $this->_roleFactory = $roleFactory; $this->_userFactory = $userFactory; $this->_rulesFactory = $rulesFactory; $this->_authSession = $authSession; $this->_filterManager = $filterManager; } /** * Preparing layout for output * * @return Role */ protected function _initAction() { $this->_view->loadLayout(); $this->_setActiveMenu('Magento_User::system_acl_roles'); $this->_addBreadcrumb(__('System'), __('System')); $this->_addBreadcrumb(__('Permissions'), __('Permissions')); $this->_addBreadcrumb(__('Roles'), __('Roles')); return $this; } /** * Initialize role model by passed parameter in request * * @param string $requestVariable * @return \Magento\Authorization\Model\Role */ protected function _initRole($requestVariable = 'rid') { $role = $this->_roleFactory->create()->load($this->getRequest()->getParam($requestVariable)); // preventing edit of relation role if ($role->getId() && $role->getRoleType() != RoleGroup::ROLE_TYPE) { $role->unsetData($role->getIdFieldName()); } $this->_coreRegistry->register('current_role', $role); return $this->_coreRegistry->registry('current_role'); } }