Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support dynamic population of make_router() #79

Open
uvedhe opened this issue Feb 16, 2021 · 0 comments
Open

Feature request: support dynamic population of make_router() #79

uvedhe opened this issue Feb 16, 2021 · 0 comments

Comments

@uvedhe
Copy link

uvedhe commented Feb 16, 2021

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!

Thanks for all the great work

@uvedhe uvedhe changed the title Feature: support dynamic population of make_router() Feature request: support dynamic population of make_router() Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant