For sure! Try something like this:
``` r
library(connectapi)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
readRenviron("~/rstudio/connectapi/.Renviron.alt")
client <- connect()
#> Defining Connect with host: https://colorado.rstudio.com/rsc
bnd <- bundle_dir("~/rstudio/connectapi/tests/testthat/examples/static")
#> Bundling directory ~/rstudio/connectapi/tests/testthat/examples/static
item1 <- deploy(client, bnd, "add_collaborator_testing")
#> Getting content endpoint
#> Creating NEW content 302dfef1-e7dd-49a8-b941-f88d752c90fd with name add_collaborator_testing on https://colorado.rstudio.com/rsc
#> Uploading bundle
#> Deploying bundle
all_users <- get_users(client)
one_user <- all_users %>% filter(username == "alex.gold")
one_user_guid <- one_user %>% pull(guid)
item1 %>%
acl_add_collaborator(
one_user_guid
)
#> Warning: The `acl_add` function is experimental and subject to change without warning in a future release
#> This warning is displayed once per session.
#> RStudio Connect Task:
#> Content GUID: 302dfef1-e7dd-49a8-b941-f88d752c90fd
#> Task ID: slb1kflUmvqhn4qJ
item1 %>%
get_acl_user()
#> Warning: The `get_acl` function is experimental and subject to change without warning in a future release
#> This warning is displayed once per session.
#> # A tibble: 2 x 16
#> email username first_name last_name user_role created_time
#> <chr> <chr> <chr> <chr> <chr> <dttm>
#> 1 cole… cole Cole Arendt administ… 2017-10-31 20:22:57
#> 2 alex… alex.go… Alex Gold administ… 2019-03-18 18:55:08
#> # … with 10 more variables: updated_time <dttm>, active_time <dttm>,
#> # confirmed <lgl>, locked <lgl>, guid <chr>, app_role <chr>, is_owner <lgl>,
#> # password <chr>, content_guid <chr>, content_access_type <chr>
Created on 2021-01-20 by the reprex package (v0.3.0)
I hope that helps!! I'm very curious to hear more about how this goes and if you have any questions / suggestions for what could make it easier!