Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function setPath($path, array $params = array())
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setPath');
     if (!$pluginInfo) {
         return parent::setPath($path, $params);
     } else {
         return $this->___callPlugins('setPath', func_get_args(), $pluginInfo);
     }
 }
 /**
  * @param \Magento\Authorization\Model\Role $role
  * @param array $data
  * @param \Magento\Backend\Model\View\Result\Redirect $resultRedirect
  * @return \Magento\Backend\Model\View\Result\Redirect
  */
 protected function saveDataToSessionAndRedirect($role, $data, $resultRedirect)
 {
     $this->_getSession()->setData(self::ROLE_EDIT_FORM_DATA_SESSION_KEY, ['rolename' => $data['rolename']]);
     $this->_getSession()->setData(self::IN_ROLE_USER_FORM_DATA_SESSION_KEY, $data['in_role_user']);
     $this->_getSession()->setData(self::IN_ROLE_OLD_USER_FORM_DATA_SESSION_KEY, $data['in_role_user_old']);
     if ($data['all']) {
         $this->_getSession()->setData(self::RESOURCE_ALL_FORM_DATA_SESSION_KEY, $data['all']);
     } else {
         $resource = isset($data['resource']) ? $data['resource'] : [];
         $this->_getSession()->setData(self::RESOURCE_FORM_DATA_SESSION_KEY, $resource);
     }
     $arguments = $role->getId() ? ['rid' => $role->getId()] : [];
     return $resultRedirect->setPath('*/*/editrole', $arguments);
 }