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.

setCrunchyAuthorization(func)

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

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