Callback for "role-update" command
349710
public function cmdUpdateRole()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (!is_numeric($params[0])) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmittedList('permissions');
        $this->setSubmitted('update', $params[0]);

        $this->validateComponent('user_role');

        $this->updateRole($params[0]);
        $this->output();
    }
852156
def upgrade():
    """"""
    op.create_table(
        'access_actionsroles',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('role_id', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(['role_id'], [u'accounts_role.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'role_id',
                            name='access_actionsroles_unique')
    )
    op.create_index(
        op.f('ix_access_actionsroles_action'), 'access_actionsroles',
        ['action'], unique=False)
    op.create_index(
        op.f('ix_access_actionsroles_argument'), 'access_actionsroles',
        ['argument'], unique=False)
    op.create_table(
        'access_actionsusers',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('user_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'user_id',
                            name='access_actionsusers_unique')
    )
    op.create_index(
        op.f('ix_access_actionsusers_action'), 'access_actionsusers',
        ['action'], unique=False)
    op.create_index(
        op.f('ix_access_actionsusers_argument'), 'access_actionsusers',
        ['argument'], unique=False)
1017314
def update_command(args):
    """"""
    updated = update_requirements_file(
        args.requirements_file, args.skip_packages)

    if updated:
        print('Updated requirements in {}:'.format(args.requirements_file))

        for item in updated:
            print(' * {} from {} to {}.'.format(*item))
    else:
        print('All dependencies in {} are up-to-date.'.format(
            args.requirements_file))
1035517
def update_role_mappings(obj, wfs=None, reindex=True):
    
    wftool = api.get_tool("portal_workflow")
    if wfs is None:
        wfs = get_workflows()
    chain = wftool.getChainFor(obj)
    for wfid in chain:
        wf = wfs[wfid]
        wf.updateRoleMappingsFor(obj)
    if reindex is True:
        obj.reindexObject(idxs=["allowedRolesAndUsers"])
    return obj
21113
public function cmdPermDeleteRole()
    {
        list($role_id, $existing, $submitted) = $this->getPermissionsRole();

        $data = array(
            'permissions' => array_unique(array_diff($existing, $submitted))
        );

        $this->setSubmitted(null, $data);
        $this->setSubmitted('update', $role_id);

        $this->validateComponent('user_role');

        $this->updateRole($role_id);
        $this->output();
    }
491157
def update(gandi, email, password, quota, fallback, alias_add, alias_del):
    """"""
    options = {}

    if password:
        password = click.prompt('password', hide_input=True,
                                confirmation_prompt=True)
        options['password'] = password

    if quota is not None:
        options['quota'] = quota

    if fallback is not None:
        options['fallback_email'] = fallback

    login, domain = email

    result = gandi.mail.update(domain, login, options, alias_add, alias_del)

    return result
1079611
async function updatePermission (permissionModel, roleId, resourceType, resourceName, updateFn) {
  ForNow(resourceType)

  const grants = await getGrantsFor(
    permissionModel,
    roleId,
    resourceName
  )

  const revisedGrants = updateFn(grants)
  if (revisedGrants === false) return // nothing to do!

  await setGrantsFor(
    permissionModel,
    roleId,
    resourceName,
    revisedGrants
  )
}
1119541
function updateActions() {
        this.plugin('done', function () {
          var cmd;
          if (envOptions['update-actions']) {
            // Don't disable actions since this is mostly for development.
            cmd = 'python manage.py update_actions';

            childProcess.exec(cmd, function (err, stdout, stderr) {
              console.log('\n' + BOLD + 'Updating Actions' + END_BOLD);
              console.log(stdout);
              if (stderr) {
                console.error(stderr);
              }
            });
          }
        });
      }
1166219
def update_roles(role_ids)
      @roles = []
      role_ids.each do |id|
        # It is posible for members to have roles that do not exist
        # on the server any longer. See https://github.com/meew0/discordrb/issues/371
        role = @server.role(id)
        @roles << role if role
      end
    end
435620
def upgrade():
    """"""
    op.create_table(
        'access_actionssystemroles',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('role_name', sa.String(length=40), nullable=False),
        sa.PrimaryKeyConstraint('id',
                                name=op.f('pk_access_actionssystemroles')),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'role_name',
                            name='access_actionssystemroles_unique')
    )
    op.create_index(op.f('ix_access_actionssystemroles_action'),
                    'access_actionssystemroles', ['action'], unique=False)
    op.create_index(op.f('ix_access_actionssystemroles_argument'),
                    'access_actionssystemroles', ['argument'], unique=False)
    op.create_index(op.f('ix_access_actionssystemroles_role_name'),
                    'access_actionssystemroles', ['role_name'], unique=False)
634436
def update_role(id, name)
      current_path = "/api/v1/roles/#{id}/update"
      payload = { 'new_name' => name }.to_json
      @conn.put(current_path, payload)
    end
570905
public function updateRoleDraft($roleId, Request $request)
    {
        $createStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        try {
            // First try to load the draft for given role.
            $roleDraft = $this->roleService->loadRoleDraftByRoleId($roleId);
        } catch (NotFoundException $e) {
            // We might want a newly created role, so try to load it by its ID.
            // loadRoleDraft() might throw a NotFoundException (wrong $roleId). If so, let it bubble up.
            $roleDraft = $this->roleService->loadRoleDraft($roleId);
        }

        return $this->roleService->updateRoleDraft($roleDraft, $this->mapToUpdateStruct($createStruct));
    }
1048452
public function editUserRole($role_id = null)
    {
        $this->setUserRole($role_id);
        $this->setTitleEditUserRole();
        $this->setBreadcrumbEditUserRole();

        $this->setData('role', $this->data_role);
        $this->setData('permissions', $this->getPermissionsUserRole(true));

        $this->submitEditUserRole();
        $this->outputEditUserRole();
    }
414987
public function update(Request $request, Role $role)
    {
        $this->authorize('update', Role::class);
        $this->validate($request, [
            'name'        => 'required|max:255',
            'color'       => 'required|size:7',
            'description' => 'required|max:500',
        ]);
        $role->update($request->all());

        return redirect()->route('laralum::roles.index')->with('success', __('laralum_roles::general.role_updated', ['id' => $role->id]));
    }
813878
protected function updateRoles()
    {
        foreach ($this->roles() as $Role) {
            $this->authManager->add($Role);

            echo sprintf('    > role `%s` added.', $Role->name) . PHP_EOL;
        }
    }
31562
public function cmdPermAddRole()
    {
        list($role_id, $existing, $submitted) = $this->getPermissionsRole();

        $data = array('permissions' => array_unique(array_merge($existing, $submitted)));

        $this->setSubmitted(null, $data);
        $this->setSubmitted('update', $role_id);

        $this->validateComponent('user_role');

        $this->updateRole($role_id);
        $this->output();
    }
619251
public function update($id, UpdateRoleRequest $request)
    {
        $role = $this->repository->findWithoutFail($id);

        if (empty($role)) {
            return $this->sendError('Role not found');
        }

        $role = $this->repository->update($request->all(), $id);
        $role->load($request->getWith());

        return $this->sendResponse($role, 'Role updated successfully.');
    }