I was very excited to discover shiny.router and incorporate it into my Shiny application. Managed to get it to work only to realise a caveat in my specific situation: I've built a Shiny app that uses a browser's cookie to determine the permissions a user has (allowing it to show certain tabs but not others). This functionality requires the tabs to be populated in server.R, since the cookie must be passed using Shiny's input$. However, make_router() must be ran in Global.R to be available to ui.R.
Initially I fixed this by only displaying the buttons/links for the tabs the user was allowed to see, but then noticed that the way router works is that it populates the entire ui, then toggles hide/show depending on the URL we're on (clever!). However, in my example this means the user can see tabs they shouldn't be able to see by simply going into their browser's console.
Another solution would be to dynamically populate make_router(), but that's not possible since the permissions aren't known yet to Global.R, since it's ran before server.R.
It'd be great if 'make_router()' could somehow support a dynamic inclusion/exclusion (ran from Server.R). Might be quite a stretch, but thought I'd highlight it just in case!
I was very excited to discover shiny.router and incorporate it into my Shiny application. Managed to get it to work only to realise a caveat in my specific situation: I've built a Shiny app that uses a browser's cookie to determine the permissions a user has (allowing it to show certain tabs but not others). This functionality requires the tabs to be populated in
server.R
, since the cookie must be passed using Shiny'sinput$
. However,make_router()
must be ran inGlobal.R
to be available toui.R
.Initially I fixed this by only displaying the buttons/links for the tabs the user was allowed to see, but then noticed that the way
router
works is that it populates the entire ui, then toggles hide/show depending on the URL we're on (clever!). However, in my example this means the user can see tabs they shouldn't be able to see by simply going into their browser's console.Another solution would be to dynamically populate
make_router()
, but that's not possible since the permissions aren't known yet to Global.R, since it's ran before server.R.It'd be great if 'make_router()' could somehow support a dynamic inclusion/exclusion (ran from Server.R). Might be quite a stretch, but thought I'd highlight it just in case!
Thanks for all the great work