Hi, testing out some simple security aspects of AppGyver and not seeing how to do this.
If I have a security system that limits access to certain pages depending on the user’s access level, how do I not display those pages in the navigation menu or reject access to it if a non-authorised user tries to go to the page?
Just to make it simple, I have an App Variable called authUser which has a boolean property called isAdmin. I have a page called Users which only a user who isAdmin can access.
Current navigation editor doesn’t allow you to hide the item from navigation for only some users. This should be possible in the upcoming advanced navigation editor, but that’s still some weeks into the future.
Now you can use Page focused event to test your isAdmin variable value. If it’s false, use Navigate back Flow function immediately.
Hi! I would recommend building a custom navigation menu as I’m unsure what navigating back would do on the bottom of the navigation stack (which is a navigation menu item). Another option is just to hide all the content on the page for non-admin and showing e.g. “This content is restricted” warning instead.
Yeah, if you create your own controls you have full control of what to show and when.
Well, not really. You need to copy paste the menu to all pages it should be on. If you want to make changing styles easier for you, use shared styles for the menu, so then when you change the shared style for one, you will change them all.