deleteDatabaseUser: deleteDatabaseUser

View source: R/databases.R

deleteDatabaseUserR Documentation

deleteDatabaseUser

Description

Deletes a user from a database.

Usage

deleteDatabaseUser(databaseId, userId)

Arguments

databaseId

the id of the database

userId

the (numeric) id of the user to remove from the database.

Details

The user will receive a notification that their permission to access the database has been revoked.

Examples

## Not run: 

# Get the list of users in the database
databaseId <- "cxy12345gh"
users <- getDatabaseUsers(databaseId)

# Find the user with the email "bob@example.com"
matching <- sapply(users, function(u) u$email == "bob@example.com")
bob <- users[[which(matching)]]

# Remove the user from the database
deleteDatabaseUser(databaseId = databaseId, userId = bob$userId)

# You could also remove all users
for(user in users) {
  deleteDatabaseUser(databaseId = databaseId, userId = user$userId)
}

## End(Not run)


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