Custom Menu depending on user role


would like to point to different web-menu.xml files depending on the user role. Any ideas?
Alternatively I may extend the MainScreen and adapt the menu to the given logged in role. However the first approach looks neater to me.

Many thanks in advance.


Hi @carloscz25 ,

Cuba is supporting you by two types of menu SideMenu and AppMenu

you can add all your menu items inside any of them and control access to show and hide according to role permission

You still have the option to implement your own custom menu at run time and append all menu items at run time according to each user role permission

Another way if you want to implement your own custom-menu the same has been done inside sampler demo application sampler-github-link you can follow the steps their

Also i have implemented custom menu display that contian both AppMenu and SideMenu on which the AppMenu controll what is displayed inside SideMenu AppMenu-SideMenu

here how it will looks like post-appmenu-sidemenu


1 Like

Hello @carloscz25

You can manage menu items visibility via Role settings: Documentation


Thank you both.

You are absolutely right Daniil. I read about it in the documentation. Should have remembered it.