R/user-info.R

Defines functions .getUsers

#' Get information about users who have access to a dataset
#'
#' Get user metadata about all of the users that have access to a particular
#' Crunch object like a dataset or project. Returns a `UserCatalog` object which
#' can be translated into a data.frame with [catalogToDataFrame()] if information
#' needs to be extracted, queried, transformed, etc.
#'
#' @param x a `CrunchDataset`, `DatasetTuple`, or `ProjectFolder` object to get
#' users from
#'
#' @return a `UserCatalog` with information about users who have access to the
#' dataset
#'
#' @name users
setGeneric("users", function(x) standardGeneric("users"))

.getUsers <- function(x) UserCatalog(crGET(shojiURL(x, "catalogs", "users")))

#' @rdname users
#' @export
setMethod("users", "CrunchDataset", .getUsers)

#' @rdname users
#' @export
setMethod("users", "DatasetTuple", .getUsers)

#' @rdname users
#' @export
setMethod("users", "ProjectFolder", .getUsers)

Try the crunch package in your browser

Any scripts or data that you put into this service are public.

crunch documentation built on Aug. 31, 2023, 1:07 a.m.