Skip to content

Commit 6f8b238

Browse files
committed
Inline a call to get_token
1 parent b490ae4 commit 6f8b238

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

R/dataone.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,12 @@ is_authorized <- function(node, ids, action) {
117117
stopifnot(is.character(ids))
118118
stopifnot(action %in% c("read", "write", "changePermission"))
119119

120-
token <- get_token(node)
121120
base_url <- paste0(node@baseURL, "/", node@APIversion)
122121

123122
sapply(ids, function(id) {
124123
req <- httr::GET(paste0(base_url, "/isAuthorized/", id),
125124
query = list(action = action),
126-
httr::add_headers("Authorization" = paste0("Bearer ", token)))
125+
httr::add_headers("Authorization" = paste0("Bearer ", get_token(node))))
127126

128127
if (req$status_code == 200) {
129128
return(TRUE)

0 commit comments

Comments
 (0)