Skip to contents

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.