Exemplo n.º 1
0
 /**
  * Creates rules model
  *
  * @return \Magento\Authorization\Model\Rules
  */
 public function createRules()
 {
     return $this->_rulesFactory->create();
 }
Exemplo n.º 2
0
 /**
  * Associate resources with the specified role. All resources previously assigned to the role will be unassigned.
  *
  * @param \Magento\Authorization\Model\Role $role
  * @param string[] $resources
  * @return void
  * @throws \LogicException
  */
 protected function _associateResourcesWithRole($role, $resources)
 {
     /** @var \Magento\Authorization\Model\Rules $rules */
     $rules = $this->_rulesFactory->create();
     $rules->setRoleId($role->getId())->setResources($resources)->saveRel();
 }