Skip to content

Commit

Permalink
updating getDatabaseUsers() to add locked, userLicenseType, activitat…
Browse files Browse the repository at this point in the history
…ionStatus, lastLoginDate and adjusting the related tests
  • Loading branch information
nickdickinson committed Nov 28, 2024
1 parent b235593 commit 33b4743
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion R/databases.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ getDatabaseUsers <- function(databaseId, asDataFrame = TRUE) {
version = unlist(lapply(users, function(x) {x$version})),
inviteDate = as.Date(unlist(lapply(users, function(x) {x$inviteDate}))),
deliveryStatus = unlist(lapply(users, function(x) {x$deliveryStatus})),
inviteAccepted = unlist(lapply(users, function(x) {x$inviteAccepted}))
inviteAccepted = unlist(lapply(users, function(x) {x$inviteAccepted})),
locked = unlist(lapply(users, function(x) {x$locked})),
userLicenseType = unlist(lapply(users, function(x) {x$userLicenseType})),
lastLoginDate = as.Date(unlist(lapply(users, function(x) {if(is.null(x$lastLoginDate)) NA else x$lastLoginDate}))),
activationStatus = unlist(lapply(users, function(x) {x$activationStatus}))
)

usersDF$role <- lapply(users, function(x) {x$role})
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-databases.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ deleteTestUsers <- function(database, returnedUsers) {

# Simplifies the user object for snapshots and warns when expected fields are missing and provides an informative message when there are new fields
simplifyUsers <- function(returnedUsers, additionalFields = list(), addedUsers = FALSE, expectAdded = TRUE) {
expectedFields <- c(additionalFields, "databaseId","deliveryStatus","email", "name", "role", "userId")
expectedFields <- c(additionalFields, "databaseId","deliveryStatus","email", "name", "role", "userId", "locked")

if (addedUsers) {
expectedFields <- c("inviteTime",'version', 'activationStatus', 'lastLoginTime', 'grants', expectedFields)
Expand Down

0 comments on commit 33b4743

Please sign in to comment.