Skip to contents

Extracts elements from either config, url (shiny), shiny session or environmental variables relevant for user data such as name, group, role and org id (e.g. resh id). Source of info is based on environment context and can be controlled by altering the default settings for which contexts that will apply for the various sources of user data. This function will normally be used via its helper functions (see below).

Usage

userInfo(
  entity,
  shinySession = NULL,
  devContexts = c("DEV"),
  testContexts = c("TEST"),
  prodContexts = c("QA", "QAC", "PRODUCTION", "PRODUCTIONC"),
  group = NULL
)

Arguments

entity

String defining the element to return. Currently, one of 'user', groups', 'resh_id', 'role', 'email', 'full_name' or 'phone'.

shinySession

Shiny session object (list, NULL by default). Must be provided when the source of user attributes is either the shiny app url or an external authentication provider. By default this will apply to the 'TEST', 'QA' and 'PRODUCTION' contexts in which case the shiny session object must be provided.

devContexts

A character vector providing unique instances to be regarded as a development context. In this context user attributes will be read from configuration as provided by 'rapbaseConfig.yml'. The instances provided cannot overlap instances provided in any other contexts. By default set to c("DEV").

testContexts

A character vector providing unique instances to be regarded as a test context. In this context user attributes will be read from the url call to a shiny application. Hence, for this context the corresponding shiny session object must also be provided. The instances provided cannot overlap instances provided in any other contexts. By default set to c("TEST").

prodContexts

A character vector providing unique instances to be regarded as a production context. In this context user attributes will be read from the shiny session object (on deployment in shiny-server) or, from environmental variables (on standalone container deployment). Hence, for this context the corresponding shiny session object must also be provided. Instances provided cannot overlap instances in any other contexts. By default set to c("QA", "QAC", "PRODUCTION", "PRODUCTIONC"). Duplication as seen by the "C" suffix will be needed as long as apps in question are to be run on both shiny-server and as standalone containers.

group

Character string providing the name of the app R package name. The term "group" is used to relate to the environmental variable SHINYPROXY_USERGROUPS that corresponds to the apps a given user can access.

Value

String of single user data element