Customized App Menu depending on the current user

Right now am working on an application, and that application has many users, I want to restrict user access to certain tables, but I want to do it through a customized menu. For example, the users with the "Admin" role can see all the menu items, whereas those with the "User" role see only certain menu items, and so. some users have a role to view only and other users have a role to edit, but not to add new.

I have been working on this for days, but I couldn't figure it out, please is there any example or solution?

Solved Solved
0 4 380
  • UX
1 ACCEPTED SOLUTION

You can store the clearance level for each menu item (admin or user) on a single column, and then you can create a slice for the menu options that the user is allowed to see.

Let's say you have an user table with a [Type] column with the options "Admin" or "User", and also a slice of your users table with the slice condition [Email]=useremail(), let's call that "currentUser" slice

Then you could use this as your slice condition for the menu table:

INDEX(currentUser[Type],1)

And that's it hehe, if you're interested about the currentUser slice, you can read more here:

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Current-User-Slice-How-to-conform-your-app-aroun...

View solution in original post

4 REPLIES 4

Thank you for your quick reply.  I have two types of users Admin and normal user, I want to show the admin the full home menu, but in the case of normal user I want to show him only a few menu items.

I created the following table, and I added two extra columns

IsAdmin and IsUser, 

Nasser_Tabook_0-1649365447753.png

 

then i created two slices, one to show the IsUser menu and the other show the IsAdmin menu

I don't know is this a good way or not, 

You can store the clearance level for each menu item (admin or user) on a single column, and then you can create a slice for the menu options that the user is allowed to see.

Let's say you have an user table with a [Type] column with the options "Admin" or "User", and also a slice of your users table with the slice condition [Email]=useremail(), let's call that "currentUser" slice

Then you could use this as your slice condition for the menu table:

INDEX(currentUser[Type],1)

And that's it hehe, if you're interested about the currentUser slice, you can read more here:

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Current-User-Slice-How-to-conform-your-app-aroun...

Thank you for your reply. I learned a lot and it helped me to solve other questions in regards to the ability to read, edit and delete on certain tables or views.

Top Labels in this Space