/** * {@inheritdoc} */ public function getRoleUsers() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getRoleUsers'); if (!$pluginInfo) { return parent::getRoleUsers(); } else { return $this->___callPlugins('getRoleUsers', func_get_args(), $pluginInfo); } }
public function testGetRoleUsers() { $this->assertEmpty($this->_model->getRoleUsers()); $this->_model->load(\Magento\TestFramework\Bootstrap::ADMIN_ROLE_NAME, 'role_name'); $this->assertNotEmpty($this->_model->getRoleUsers()); }
/** * Update role users ACL * * @param \Magento\Authorization\Model\Role $role * @return bool */ public function updateRoleUsersAcl(\Magento\Authorization\Model\Role $role) { $connection = $this->getConnection(); $users = $role->getRoleUsers(); $rowsCount = 0; if (sizeof($users) > 0) { $bind = ['reload_acl_flag' => 1]; $where = ['user_id IN(?)' => $users]; $rowsCount = $connection->update($this->_usersTable, $bind, $where); } return $rowsCount > 0; }
/** * Update role users ACL * * @param \Magento\Authorization\Model\Role $role * @return bool */ public function updateRoleUsersAcl(\Magento\Authorization\Model\Role $role) { $write = $this->_getWriteAdapter(); $users = $role->getRoleUsers(); $rowsCount = 0; if (sizeof($users) > 0) { $bind = array('reload_acl_flag' => 1); $where = array('user_id IN(?)' => $users); $rowsCount = $write->update($this->_usersTable, $bind, $where); } return $rowsCount > 0; }