From da07391042338c86a2ce18b8313a065f2e47f9b5 Mon Sep 17 00:00:00 2001 From: avsdev-cw Date: Mon, 9 Nov 2020 12:35:45 +0000 Subject: [PATCH] Un-documented exports of functions to get things working --- R/Groups.R | 6 ++++++ R/UserGroups.R | 2 ++ R/Users.R | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/R/Groups.R b/R/Groups.R index 740ed39..5325fe1 100644 --- a/R/Groups.R +++ b/R/Groups.R @@ -1,4 +1,5 @@ +#' @export group_id <- function(name, ...) { checkmate::assert_string(name) conn_ref <- modb_conn_ref(args = list(...)) @@ -6,9 +7,11 @@ group_id <- function(name, ...) { res <- .Call(c_rmodb_groupId, conn_ref, name) return(res) } +#' @export group_exists <- function(name, ...) { return(!is.na(group_id(name))) } +#' @export group_create <- function(name, id = NULL, ...) { checkmate::assert_string(name) if (!checkmate::test_null(id)) { @@ -21,6 +24,7 @@ group_create <- function(name, id = NULL, ...) { res <- .Call(c_rmodb_createGroup, conn_ref, as.integer(id), name) return(res) } +#' @export group_delete <- function(id, ...) { checkmate::assert_int(id) conn_ref <- modb_conn_ref(args = list(...)) @@ -28,6 +32,7 @@ group_delete <- function(id, ...) { res <- .Call(c_rmodb_deleteGroup, conn_ref, as.integer(id)) return(res) } +#' @export group <- function(id, withMembers = TRUE, ...) { checkmate::assert_int(id) checkmate::assert_logical(withMembers) @@ -36,6 +41,7 @@ group <- function(id, withMembers = TRUE, ...) { res <- .Call(c_rmodb_group, conn_ref, as.integer(id), as.logical(withMembers)) return(res) } +#' @export groups <- function(withMembers = FALSE, withDeleted = FALSE, ...) { checkmate::assert_logical(withMembers) diff --git a/R/UserGroups.R b/R/UserGroups.R index 060f707..df2f0a6 100644 --- a/R/UserGroups.R +++ b/R/UserGroups.R @@ -1,4 +1,5 @@ +#' @export link_user_group <- function(user, group, ...) { conn_ref <- modb_conn_ref(args = list(...)) if (checkmate::test_list(user)) { @@ -21,6 +22,7 @@ link_user_group <- function(user, group, ...) { return(res) } +#' @export unlink_user_group <- function(user, group, ...) { conn_ref <- modb_conn_ref(args = list(...)) if (checkmate::test_list(user)) { diff --git a/R/Users.R b/R/Users.R index b601f93..9e288ea 100644 --- a/R/Users.R +++ b/R/Users.R @@ -1,4 +1,5 @@ +#' @export user_id <- function(name, ...) { checkmate::assert_string(name) conn_ref <- modb_conn_ref(args = list(...)) @@ -6,9 +7,11 @@ user_id <- function(name, ...) { res <- .Call(c_rmodb_userId, conn_ref, name) return(res) } +#' @export user_exists <- function(name, ...) { return(!is.na(user_id(name))) } +#' @export user_create <- function(name, email, id = NULL, ...) { checkmate::assert_string(name) checkmate::assert_string(email) @@ -22,6 +25,7 @@ user_create <- function(name, email, id = NULL, ...) { res <- .Call(c_rmodb_createUser, conn_ref, as.integer(id), name, email) return(res) } +#' @export user_delete <- function(id, ...) { checkmate::assert_int(id) conn_ref <- modb_conn_ref(args = list(...)) @@ -29,6 +33,7 @@ user_delete <- function(id, ...) { res <- .Call(c_rmodb_deleteUser, conn_ref, as.integer(id)) return(res) } +#' @export user <- function(id, withGroups = TRUE, ...) { checkmate::assert_int(id) checkmate::assert_logical(withGroups) @@ -38,6 +43,7 @@ user <- function(id, withGroups = TRUE, ...) { return(res) } +#' @export users <- function(withGroups = FALSE, withDeleted = FALSE, ...) { checkmate::assert_logical(withGroups)