Update a user.

  Replaces the user's details with those provided.

  @param resource_root: The root Resource object
  @param user: An ApiUser object
  @return: An ApiUser object
961345
def update_user(resource_root, user):
  
  return call(resource_root.put,
      '%s/%s' % (USERS_PATH, user.name), ApiUser, data=user)
332025
public Response updateUser(UserEntity userEntity) {
		return restClient.put("users/" + userEntity.getUsername(), userEntity, new HashMap<String, String>());
	}
722741
def delete_user(self, user):
        
        user_id = utils.get_id(user)
        uri = "users/%s" % user_id
        resp, resp_body = self.method_delete(uri)
        if resp.status_code == 404:
            raise exc.UserNotFound("User '%s' does not exist." % user)
        elif resp.status_code in (401, 403):
            raise exc.AuthorizationFailure("You are not authorized to delete "
                    "users.")
597240
public static mpsuser update(nitro_service client, mpsuser resource) throws Exception
	{
		resource.validate("modify");
		return ((mpsuser[]) resource.update_resource(client))[0];
	}
683013
def rename_user(self, old_user, new_user):
        
        if self._version > (6, 0, 0):
            url = self._options['server'] + '/rest/api/latest/user'
            payload = {
                "name": new_user}
            params = {
                'username': old_user}

            # raw displayName
            logging.debug("renaming %s" % self.user(old_user).emailAddress)

            r = self._session.put(url, params=params,
                                  data=json.dumps(payload))
            raise_on_error(r)
        else:
            raise NotImplementedError("Support for renaming users in Jira "
                                      "< 6.0.0 has been removed.")
878098
def user(self, user: str) -> "ChildHTTPAPI":
        
        if self.is_real_user:
            raise ValueError("Can't get child of real user")

        try:
            return self.children[user]
        except KeyError:
            child = ChildHTTPAPI(user, self)
            self.children[user] = child
            return child
1321397
def edituser(self, user_id, **kwargs):
        
        data = {}

        if kwargs:
            data.update(kwargs)

        request = requests.put(
            '{0}/{1}'.format(self.users_url, user_id),
            headers=self.headers, data=data, timeout=self.timeout, verify=self.verify_ssl, auth=self.auth)

        if request.status_code == 200:
            return request.json()
        else:
            return False
305440
public static base_response update(nitro_service client, aaauser resource) throws Exception {
		aaauser updateresource = new aaauser();
		updateresource.username = resource.username;
		updateresource.password = resource.password;
		return updateresource.update_resource(client);
	}
840019
def update(self, user, **kwargs):
        """"""
        yield self.get_parent()

        if not self.parent.editable:
            err = 'Cannot update child of {} resource'.format(self.parent.state.name)
            raise exceptions.Unauthorized(err)

        yield super(SubResource, self).update(user, **kwargs)
708259
@POST
  @Path("me")
  @RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
  public Response updateMe(@Context HttpServletRequest request,
                           @Context UriInfo uriInfo,
                           @Context SecurityContext securityContext,
                           DUser user) {

    Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
    if (null == user.getId()) {
      user.setId(userId);
    } else if (!user.getId().equals(userId)) {
      throw new BadRequestRestException("User ids does not match");
    }

    return update(userId, uriInfo, securityContext, user);
  }
458717
public function update(UpdateUserRequest $request, User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_UPDATE);

        $user->update($request->getValidatedData());
        $user->roles()->sync($request->get('roles'));

        $this->transNotification('updated', ['name' => $user->full_name], $user->toArray());

        return redirect()->route('admin::auth.users.show', [$user->hashed_id]);
    }
118949
def prj_add_user(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        dialog = UserAdderDialog(project=self.cur_prj)
        dialog.exec_()
        users = dialog.users
        for user in users:
            userdata = djitemdata.UserItemData(user)
            treemodel.TreeItem(userdata, self.prj_user_model.root)
        self.cur_prj.save()
201294
def update(self):
        
        if self._owner_changed:
            self.update_owner(self.owner)

        self._resources = [res.name for res in self.resources]
        return self.parent.update(self)
639178
public function updateUser(User $user)
    {
        $request = $user->toJson();
        $this->client->put(sprintf('/v2/user/%s', $user->getId()), $request);
    }
1231691
public void setUser(User user) {
		this.user = user;
		if (httpSender != null) {
			httpSender.setUser(user);
		}
	}
719693
def enable_root_user(self):
        
        uri = "/instances/%s/root" % self.id
        resp, body = self.manager.api.method_post(uri)
        return body["user"]["password"]
180957
def create_user(self, user):
        
        self.run("useradd -m %s" % user)
        usr =  getpwnam(user)
        return usr