is_enabled.connect_user_feature_flag {featureflag} | R Documentation |
Checks if the given connect user feature flag is enabled
Description
Checks if the given connect user feature flag is enabled
Usage
## S3 method for class 'connect_user_feature_flag'
is_enabled(feature_flag)
Arguments
feature_flag |
flag to be checked whether it is enabled |
Details
The session$user field is used for retrieving the information on the logged-in user
Value
TRUE if the feature flag is enabled.
Examples
{
flag <- create_connect_user_feature_flag(c("user1"))
# Returns TRUE if the session$user matches the specified users
mock_session <- shiny::MockShinySession$new()
mock_session$user <- "user1"
shiny::withReactiveDomain(
domain = mock_session,
expr = is_enabled(flag)
)
# Returns FALSE if the session$user does not match the specified users
mock_session <- shiny::MockShinySession$new()
mock_session$user <- "user2"
shiny::withReactiveDomain(
domain = mock_session,
expr = is_enabled(flag)
)
}
[Package featureflag version 0.2.0 Index]