addDatabaseUser

Description

Invites a user to a database.

Usage

addDatabaseUser(
  databaseId,
  email,
  name,
  locale = NA_character_,
  roleId,
  roleParameters = list(),
  roleResources = list(databaseId)
)

Arguments

Argument Description
databaseId the id of the database to which they should be added
email the user's email
name the user's name (only used if they do not already have an ActivityInfo account)
locale the locale ("en', "fr", "ar", etc) to use inviting the user (only used if they do not already have an ActivityInfo account)
roleId the id of the role to assign to the user.
roleParameters a named list containing the role parameter values
roleResources a list of folders in which this role should be assigned (or the databaseId if they should have this role in the whole database)

Details

This function adds a new user to a database and assigns them a role.

If there is no user account with the given email address, an email is sent in the given locale to the email address inviting the user to activate their account.

If there is an ActivityInfo account with the given email address, an email is sent notifying the user of their new role.

In ActivityInfo, permissions are managed through roles . Roles include a set of permissions. When a user is assigned a role, they inherit those permissions from the role.

Some roles are parameterized . For example, the "Reporting Partner" role included in many database templates has a partner parameter that is used to filter which records are visible to the user. The value of this parameter is the record id of the user's partner in the related Partner form.

Examples

# Invite a user in the French locale, in the admin role.
# The invitation email will be in French.
addDatabaseUser(databaseId = "ck3pqrp9a1z",
   email = "alice@example.fr",
   name = "Alice Otieno",
   locale = "fr",
   roleId = "admin")

# Add a user with a "Reporting Partner" role (rp)
redcrossPartnerRecordId <- "ck5m79b9c2"
addDatabaseUser(databaseId = "ck3pqrp9a1z",
   email = "bob@example.org",
   name = "Bob",
   roleId = "rp",
   roleParameters = list(partner = redcrossPartnerRecordId))
Next item
addFilter