Hide Navigation Item based on functionality not just based on user roles

0
We are developing multi license Mendix application and require to hide certain items ( functionality) from navigation profile not just based on user roles. Onclick microflow can be used to check for certain flags but can we hide entire item from navigation based on certain checks(flags) ? so there will not be click action to check the access for the functionality
asked
1 answers
1

First hide the navigation elements that you want hidden by adding to your scss somewhere

a.mx-name-menuBar1-10 {
    display:none;
    .doshow {
        display:flex;
    }
}

Then add a javascript to add a class to each navigation element that you want to show:

  • Use mx.data.callNanoflow(...) like here on https://apidocs.rnd.mendix.com/8/client/mx.data.html
  • Make the nanoflow do your checks, decide if elements need to get shown
  • in the callback, process the result and where needed add a class ‘doshow’ to the showable navigation items like a.mx-name-menubar1-10

This is untested, but I hope you manage to get this working. Please keep us posted.

answered