Grant individuals or other groups access to files, including permission to
read, comment, or edit. The returned dribble will have extra columns,
shared and permissions_resource. Read more in drive_reveal().
drive_share(file, role = c("reader", "commenter", "writer", "owner", "organizer"), type = c("user", "group", "domain", "anyone"), ..., verbose = TRUE)
| file | Something that identifies the file(s) of interest on your Google
Drive. Can be a character vector of names/paths, a character vector of file
ids or URLs marked with |
|---|---|
| role | Character. The role to grant. Must be one of:
|
| type | Character. Describes the grantee. Must be one of:
|
| ... | Name-value pairs to add to the API request. This is where you
provide additional information, such as the |
| verbose | Logical, indicating whether to print informative messages
(default |
An object of class dribble, a tibble with one row per item.
Wraps the permissions.update endpoint:
# NOT RUN { ## Upload a file to share file <- drive_upload( drive_example("chicken.txt"), name = "chicken-share.txt", type = "document" ) ## Let a specific person comment file <- file %>% drive_share( role = "commenter", type = "user", emailAddress = "susan@example.com" ) ## Let a different specific person edit and customize the email notification file <- file %>% drive_share( role = "writer", type = "user", emailAddress = "carol@example.com", emailMessage = "Would appreciate your feedback on this!" ) ## Let anyone read the file file <- file %>% drive_share(role = "reader", type = "anyone") ## Clean up drive_rm(file) # }