Skip to contents

Updates the specified user in regard to the specified base on a NocoDB server via its PATCH /api/v2/meta/bases/{id_base}/users/{id_user} or PATCH /api/v1/db/meta/projects/{id_base}/users/{id_user} API endpoint, depending on api_version.

Usage

update_base_user(
  user_email,
  role = c("no-access", "viewer", "commenter", "editor", "creator"),
  id_user = user_id(user_email = user_email, id_base = id_base, origin = origin, email =
    email, password = password, api_token = api_token),
  id_base = base_id(origin = origin, email = email, password = password, api_token =
    api_token),
  origin = pal::pkg_config_val("origin"),
  email = pal::pkg_config_val("email"),
  password = pal::pkg_config_val("password"),
  api_token = pal::pkg_config_val("api_token"),
  api_version = c("v2", "v1"),
  quiet = FALSE
)

Arguments

user_email

character(1)
E-mail address of the user.

role

character(1)
Base role to assign to the user. One of "no-access", "viewer", "commenter", "editor" or "creator".

id_user

character(1)
NocoDB user identifier as returned by user_id().

id_base

character(1)
NocoDB base identifier as returned by base_id().

origin

character(1)
NocoDB server origin.

email

character(1)
E-mail address of the NocoDB user to authenticate with.

password

character(1)
Password of the NocoDB user to authenticate with.

api_token

character(1)
NocoDB API token. Takes precedence over email and password if provided.

api_version

character(1)
API endpoint version to use. Either

quiet

logical(1)
Whether or not to suppress printing status output from internal processing.

Value

id_user, invisibly.

Details

Only the super admin user is allowed to use this API endpoint, i.e. the provided credentials must belong to them.

Note that for the sake of convenience, this function automatically falls back to invite_base_user() if necessary (i.e. the specified user hasn't yet been invited to the specified base).