Description Usage Arguments Value See Also Examples
crunchyServer()
and crunchyBody()
allow you to protect your app with
Crunch authentication and authorization. Add these UI contents to your
shiny::shinyUI()
body to display different content for visitors who are
not authenticated with Crunch (crunchyPublicBody()
) or who are
authenticated but not authorized to access your app
(crunchyUnauthorizedBody
).
1 2 3 |
... |
UI elements for your app, to be conditionally rendered |
An empty string; these functions are called for their side effects of
registering the UI elements so that crunchyServer()
can render them as
appropriate.
crunchyBody()
; setCrunchyAuthorization()
for governing who is
authorized to view your app.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
# This is the example from crunchyBody(), adding these alternate bodies:
shinyUI(fluidPage(
tags$head(
# This is content that will always be rendered
tags$title("My secure app")
),
crunchyBody(
# This is content that only is rendered if the user is authorized
fluidRow(
column(6, h1("Column 1")),
column(6, h1("Column 2"))
)
),
crunchyPublicBody(
# This is shown to visitors who are not logged into Crunch at all
h1("Please log into Crunch.")
),
crunchyUnauthorizedBody(
# This is for Crunch users who don't meet your authorization criteria
# Perhaps they don't have access to a particular dataset
h1("You don't have access to this app."),
tags$div("Contact your_admin@example.com.")
)
))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.