setCrunchyAuthorization: Register authorization logic for your Crunchy app

Description Usage Arguments Value Examples

Description

Call this to set an expression or server function to evaluate to determine whether the current user is authorized to access your app. Ideally, this is cheap to execute because it will be called repeatedly.

Usage

1

Arguments

func

A function (input, output, session) to call inside crunchyServer()

Value

Invisibly, the server function. This function is called for the side effect of setting the authorization function globally. The function should return TRUE if the current user is authorized.

Examples

1
2
3
4
setCrunchyAuthorization(function (input, output, session) {
    # Restrict to users who have crunch.io emails
    endsWith(email(shinyUser()()), "@crunch.io")
})

crunchy documentation built on Jan. 16, 2021, 5:17 p.m.