grant: Create a grant to define resource-level permissions

View source: R/databases.R

grantR Documentation

Create a grant to define resource-level permissions

Description

Returns a grant that can be added to a role.

Usage

grant(resourceId, permissions = resourcePermissions(), optional = FALSE)

Arguments

resourceId

the id of the resource, for example a database, folder or (sub-)form

permissions

a permission list; see resourcePermissions

optional

whether the grant is optional, by default it is not optional (=FALSE)

Details

Grants define access to resources such as databases, folders, or forms. The permissions include operations such as view, read or edit and are defined per resource. See resourcePermissions.

Adding grants to a role enables the administrator to define permissions that vary per grant and, if desired, override grants inherited from parent resources, such as a folder.

A grant can be set as optional, which means that you can choose whether to enable the grant for each user that you invite to your database.

See role for the creation of roles.

Examples

## Not run: 

optionalGrant <- 
  grant(resourceId = "ck5dxt1552",
      permissions = resourcePermissions(
        view = TRUE,
        add_record = TRUE,
        edit_record = TRUE
        ),
      optional = TRUE
)

## End(Not run)

bedatadriven/activityinfo-R documentation built on Dec. 21, 2024, 8:23 a.m.