Giving Page Access based on User Role

I am trying to set up my login to give access to a different page (Admin page) when logging in into my app as an admin. My user table has Enum values with different roles. I am able to verify the email and password, but I am not sure how to set it where it is able to filter out the role and show the page based on the role. Any suggestions? Thank you all for your help!


This question is relevant for me as well. Can Appgyver team (@Harri_Sarsa, etc.) provide potential solutions for this issue?

1 Like

@Mevi can you please help in this regard :slight_smile:

Hi! It’s very difficult to show different items in the navigation menu based on user roles, but that would be possible if you make a custom navigation menu (there are several threads on that topic on the forums).

First you need to be getting the role into the app, and then you will visibility hide/show certain elements. As far as I know, you can’t make the initial view (after login) be something else for different users, but if there is a navigation menu item or button available for admins only, they can access whatever admin-only stuff from there. However, this is especially tricky to make secure on web, if the user can guess the URL of the page not shown for them, so make additional steps to not show anything for non-admins on the page.

1 Like

Hi, you could also make 2 apps. 1 for the admin with his capabilities and 1 for the users. It’s maybe not the best performant solution but it is the easiest one.