Some pages in my application have a conditional action when the page loads. “If the user has the email field = ‘xyz’” it directs the user to another screen (access blocked).
Behavior in dev mode:
When accessing the page without having ‘permission’, either through a button or by adding the link in the search bar, the user is quickly redirected to the page defined in the workflow, the screen turns completely white for about 2 seconds and the content is loaded.
Behavior in production mode:
When accessing the page without having ‘permission’, either through a button or by adding the link in the search bar, the screen elements are loaded (a form, for example) and after about 5 seconds, the user is redirected to the previous screen.
I can’t take the risk of showing an admin screen to any user.
If anyone on the WW team wants, I have a video of how it works. I can’t post here to avoid exposing the project.
Here’s how to gate that page properly and have no risk of showing it to a user without permission.
Have a boolean field in your database that will decide whether the user is permitted or not (so Is_admin (true or false)
When you’re done creating all of the UI go to the settings tab of EACH section on the page and set a conditional visibility (USE THE SETTINGS TAB, very important). Use a boolean variable. E.g show_data (true or false), set the default for that variable to be false.
Now on page load check if the is_admin data field of current user is true, if true, change variable value show_data to true. If false, navigate to correct page.
Voila! Your page will load blank for any user who is not admin, NO MATTER HOW LONG it takes to load they will see nothing, even if they inspect the source code they will see nothing.
Man, I thought of this yesterday and worked pleasantly! I was just hoping for some other useful information on the subject and was very excited that the alternative worked well. Thank you guys!