has_group(identity, group)— is the person ingroup?has_role(identity, group, role)— does the person holdroleingroup?roles(identity, group)— every role the person holds ingroup(character(0)when none).
Arguments
- identity
An identity from
sso_finish(),hosted_identity()orhosted_identity_plumber().- group
A group name.
- role
A role name.
Details
These only report what the portal said. What a group or a role allows inside your app is your app's decision.
Examples
# A stand-in for a Shiny session inside the portal.
session <- list(request = list(
HTTP_X_SP_USERID = "ana",
HTTP_X_SP_USERGROUPS = "fiscal",
HTTP_X_RUSCKER_USER_ROLES = "fiscal:analista,fiscal:gestor"
))
id <- hosted_identity(session)
has_group(id, "fiscal")
#> [1] TRUE
has_role(id, "fiscal", "gestor")
#> [1] TRUE
roles(id, "fiscal")
#> [1] "analista" "gestor"