permissions: Content permissions

permissionsR Documentation

Content permissions

Description

Get or set content permissions for a content item

Usage

content_add_user(content, guid, role = c("viewer", "owner"))

content_add_group(content, guid, role = c("viewer", "owner"))

content_delete_user(content, guid)

content_delete_group(content, guid)

get_user_permission(content, guid, add_owner = TRUE)

get_my_permission(content, add_owner = TRUE)

get_group_permission(content, guid)

get_content_permissions(content, add_owner = TRUE)

Arguments

content

An R6 content object

guid

The guid associated with either a user (for content_add_user) or group (for content_add_group)

role

The role to assign to a user. Either "viewer" or "owner." Defaults to "viewer"

add_owner

Optional. Whether to include the owner in returned permission sets. Default is TRUE. The owner will have an NA_character_ permission "id"

Details

Permission modification:

  • ⁠content_add_*⁠ adds a permission to the content

  • ⁠content_delete_*⁠ removes a permission from the content

Permission retrieval:

  • get_content_permissions() lists permissions

  • get_my_permission() gets the permission associated with the caller.

  • get_user_permission() gets the permissions associated with a given user. It does not evaluate group memberships

  • get_group_permission() gets the permissions associated with a given group.

NOTE: by default, the owner is injected with an "NA_character_" permission id. This makes it easier to find / isolate this record.

See Also

Other content functions: content_delete(), content_item(), content_title(), content_update(), create_random_name(), dashboard_url(), dashboard_url_chr(), delete_thumbnail(), delete_vanity_url(), deploy_repo(), get_bundles(), get_environment(), get_image(), get_job(), get_jobs(), get_thumbnail(), get_vanity_url(), git, has_thumbnail(), set_image_path(), set_run_as(), set_thumbnail(), set_vanity_url(), swap_vanity_url(), terminate_jobs(), verify_content_name()


rstudio/connectapi documentation built on Dec. 20, 2024, 1:48 p.m.