checkId: Check if a User is Allowed to Participate Given his Id

Description Usage Arguments Value

View source: R/check_ID.R

Description

Check if a User is Allowed to Participate Given his Id

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
checkId(
  id,
  cntrlVals,
  location = "local",
  fileSep = ",",
  fileHeader = TRUE,
  dropDir = NULL,
  fileName = NULL,
  droptoken = NULL,
  idsVec = NULL,
  notAllowedId = "not allowed"
)

Arguments

id

string or numeric. The user id to check.

cntrlVals

list of reactive values.Controls the flow through the Experiment. Can be created with createCtrlList.

location

string. Where to get the reference database from. Must be one of "local", "dropbox" or "vector". "local" will load a txt or rds file. "dropbox" will load a csv file from the indicated dropbox account and "vector" assumes that you gave a vector of ids as input to idsVec.

fileSep

string. Passed to the read.table sep argument. Must match the separater used in the database file.

fileHeader

logical. Passed to the read.table header argument.

dropDir

string. The directory in the dropbox from which to read in the database. Must only be specified if location is set to "dropbox".

fileName

string. The database file-name, including path. Must be specified if location is one of "dropbox" or "local".

droptoken

string. The name of the rds file containing the access tokens of the dropbox account from which the data should be loaded. If file is outside the app directory full directory must be included.

idsVec

string. Vector of ids that are no longer allowed to participate. Must only be specified if location is set to "vector".

notAllowedId

string. The name (default is "not allowed") of the page that should be displayed in case the given id is occurring in the database.

Value

If id is also contained in database cntrlVals$page will be changed to notAllowedId. Does not have to be reassigned since it's a reactive value.


ndphillips/ShinyPsych documentation built on Feb. 14, 2022, 5:53 p.m.