whitelist {debrowser}R Documentation

Whitelist check

Description

After a user logs in, check to see if they are on a whitelist

Usage

whitelist(user_info, whitelist = NULL)

Arguments

user_info

the object returned by get_user_info

whitelist

A character vector of emails on whitelist

Value

TRUE if on whitelist or no whitelist, FALSE if not

Examples


## Not run: 
options(googleAuthR.scopes.selected = 
   c("https://www.googleapis.com/auth/userinfo.email",
     "https://www.googleapis.com/auth/userinfo.profile"))
                                        
googleAuthR::gar_auth()

## default is user logged in
user <- get_user_info()

the_list <- whitelist(user, c("your@email.com", 
                              "another@email.com", 
                              "yet@anotheremail.com"))

if(the_list){
  message("You are on the list.")
} else {
  message("If you're not on the list, you're not getting in.")
}




## End(Not run)

[Package debrowser version 1.6.8 Index]