Add "Display rules" for Menu Items

I think it would be great to add a kind of “display rules” to menu items

In this way, we would be able to hide some menu items from certain roles, and show it to another roles.

For example, I have some menu items I only want the admins to be able to see them.

1 Like

@dschindl this is a great idea and menus are constant topic. Unfortunately, the way our platform is currently built this is not possible. For now we recommend using different layouts/menus for different roles. Or, create a new row in the layout for each role and secure that row to the role. This will require users to refresh if changing from one account with specific role to another account with another role.

If you want an alternative solution with JavaScript you can do something like this:

if ("{loggedInUser.Role}" == "Default Users") {
    var menuItem = document.querySelector("#navbar_x_element_layout_1_3 > ul > li") = "none";

I accomplish somewhat the same effect by redirecting a user who is missing roles to an alternative page using the Security tab. In my example, someone who isn’t an Admin, Office, or Regional Manager is directed away from the Workers by Area page to the Workers by Supervisor page.