Skip to contents

is user is in admin group?

Usage

in_admin_group(u)

Arguments

u

username

Value

TRUE/FALSE to indicate if the user is part of the admin group

Examples

# save access details to file
home <- Sys.getenv('HOME')

# create carnation data area if it doesn't exist
carnation_home <- file.path(home, 'carnation/data')
if(!dir.exists(carnation_home)) dir.create(carnation_home)
#> Warning: cannot create dir '/home/runner/carnation/data', reason 'No such file or directory'

create_access_yaml(user = 'admin',
                   user_group = 'admin',
                   data_area = carnation_home)
#> Environment variable "CARNATION_ACCESS_YAML" not found.Using default location to save access yaml:/home/runner

check <- in_admin_group('user')
#> Environment variable "CARNATION_ACCESS_YAML" not found.Using default location to save access yaml:/home/runner