-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrt_user_edit.R
40 lines (36 loc) · 1.25 KB
/
rt_user_edit.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#' Edit user information
#'
#' Add a comment to an existing ticket
#'
#' @inheritParams rt_user_create
#'
#' @export
#'
#' @examples
#' \dontrun{
#' rt_user_create()
#' }
rt_user_edit <- function(user_id,
password,
name = NULL,
email_address = NULL,
real_name = NULL,
organization = NULL,
privileged = NULL,
disabled = NULL,
rt_base_url = Sys.getenv("RT_BASE_URL")) {
params <- compact(list(Name = name,
Password = password,
EmailAddress = email_address,
RealName = real_name,
Organization = organization,
Privileged = privileged,
Disabled = disabled))
#HasMember is invalid here but used in rt_ticket_links
user_info <- paste(names(params), params, sep = ": ", collapse = "\n")
url <- rt_url(rt_base_url, "user", "27", "edit")
httr::POST(url, body = list(content = user_info), httr::user_agent("https://github.com/nceas/rt"))
#TODO: make this work!
#might need specific permissions?
#got Permission denied error
}