// User refused access to requested scopes, forward the desicion to Hydra via redirection.
184697
func (c *Challenge) RefuseAccess(w http.ResponseWriter, r *http.Request) error {
	err := c.Delete(w, r)
	if err != nil {
		return err
	}

	http.Redirect(w, r, c.Redirect+"&consent=false", http.StatusFound)

	return nil
}
171993
func (a *API) DeleteUser(user *User) error {
	url := a.BuildURL("/v2/user/%d", user.Id)
	return a.Delete(url, Params{})
}
1041948
func (n *nessusImpl) DeleteUser(userID int) error {
	if n.verbose {
		log.Println("Deleting user...")
	}

	_, err := n.doRequest("DELETE", fmt.Sprintf("/users/%d", userID), nil, []int{http.StatusOK})
	return err
}
1056960
func (clnt *Client) QueryUser(policy *AdminPolicy, user string) (*UserRoles, error) {
	policy = clnt.getUsableAdminPolicy(policy)

	command := newAdminCommand(nil)
	return command.queryUser(clnt.cluster, policy, user)
}
534737
func (k *KeybaseServiceBase) FlushUserFromLocalCache(ctx context.Context,
	uid keybase1.UID) {
	k.log.CDebugf(ctx, "Flushing cache for user %s", uid)
	k.setCachedUserInfo(uid, idutil.UserInfo{})
}
464184
func (u *UserService) createUser(request *restful.Request, response *restful.Response) {
	c := appengine.NewContext(request.Request)
	usr := User{Id: request.PathParameter("user-id")}
	err := request.ReadEntity(&usr)
	if err == nil {
		item := &memcache.Item{
			Key:    usr.Id,
			Object: &usr,
		}
		err = memcache.Gob.Add(c, item)
		if err != nil {
			response.WriteError(http.StatusInternalServerError, err)
			return
		}
		response.WriteHeader(http.StatusCreated)
		response.WriteEntity(usr)
	} else {
		response.WriteError(http.StatusInternalServerError, err)
	}
}
1007769
func (c *client) User(ctx context.Context, name string) (User, error) {
	escapedName := pathEscape(name)
	req, err := c.conn.NewRequest("GET", path.Join("_api/user", escapedName))
	if err != nil {
		return nil, WithStack(err)
	}
	resp, err := c.conn.Do(ctx, req)
	if err != nil {
		return nil, WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return nil, WithStack(err)
	}
	var data userData
	if err := resp.ParseBody("", &data); err != nil {
		return nil, WithStack(err)
	}
	u, err := newUser(data, c.conn)
	if err != nil {
		return nil, WithStack(err)
	}
	return u, nil
}
959166
func (r *apiHandler) UserHasPermission(user names.UserTag, operation permission.Access, target names.Tag) (bool, error) {
	return common.HasPermission(r.state.UserPermission, user, operation, target)
}
913937
func (c *ContextAction) TriggerUser(user *User) {
	packet := MumbleProto.ContextAction{
		Session: &user.Session,
		Action:  &c.Name,
	}
	c.client.Conn.WriteProto(&packet)
}
820828
func (a adminAPIHandlers) RemoveUser(w http.ResponseWriter, r *http.Request) {
	ctx := newContext(r, w, "RemoveUser")

	objectAPI := validateAdminReq(ctx, w, r)
	if objectAPI == nil {
		return
	}

	// Deny if WORM is enabled
	if globalWORMEnabled {
		writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL)
		return
	}

	vars := mux.Vars(r)
	accessKey := vars["accessKey"]
	if err := globalIAMSys.DeleteUser(accessKey); err != nil {
		writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
	}
}
1097743
func InvalidUserIDError(err error) *influxdb.Error {
	return &influxdb.Error{
		Code: influxdb.EInvalid,
		Msg:  "user id provided is invalid",
		Err:  err,
	}
}
135321
func User(userID string, c echo.Context) (*nerdz.User, error) {
	var id uint64
	var e error
	if id, e = strconv.ParseUint(c.Param(userID), 10, 64); e != nil {
		c.JSON(http.StatusBadRequest, &Response{
			HumanMessage: "Invalid user identifier specified",
			Message:      e.Error(),
			Status:       http.StatusBadRequest,
			Success:      false,
		})
		return nil, e
	}

	var user *nerdz.User
	if user, e = nerdz.NewUser(id); e != nil {
		c.JSON(http.StatusBadRequest, &Response{
			HumanMessage: "User does not exists",
			Message:      e.Error(),
			Status:       http.StatusBadRequest,
			Success:      false,
		})
		return nil, e
	}

	me := c.Get("me").(*nerdz.User)
	if !me.CanSee(user) {
		message := "You can't see the required profile"
		c.JSON(http.StatusUnauthorized, &Response{
			HumanMessage: message,
			Message:      message,
			Status:       http.StatusUnauthorized,
			Success:      false,
		})
		return nil, errors.New(message)
	}
	return user, nil
}
712368
func (s *UserService) EnableUser(p *EnableUserParams) (*EnableUserResponse, error) {
	resp, err := s.cs.newRequest("enableUser", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r EnableUserResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
586029
func (m *MetaClient) User(ctx context.Context, name string) (*User, error) {
	users, err := m.Users(ctx, &name)
	if err != nil {
		return nil, err
	}

	for _, user := range users.Users {
		return &user, nil
	}
	return nil, fmt.Errorf("no user found")
}
731623
func (s *UserService) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error) {
	o, err := s.s.FindUser(ctx, filter)
	if err != nil {
		return nil, err
	}

	if err := authorizeReadUser(ctx, o.ID); err != nil {
		return nil, err
	}

	return o, nil
}
426132
func (c *ReactionsListCall) User(user string) *ReactionsListCall {
	c.user = user
	return c
}
1027096
func (c Config) User(ctx context.Context) (string, string, bool) {
	return ctx.Request().BasicAuth()
}