I have created a sidemenu for the main screen that holds basically an accordeon with tabs and buttons to access various parts of the application. It replaces the built-in main menu from cuba.
One part of this accordeon holds access to setup and configuration items. Obviously, I do not want all users to access this part of the menu. I thought I would hide this tab through the Roles > UI option but am not able to do so.
Below (and attached) is a test project that isolates the menu part with a setup tab to be hidden to users depending on their role.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <window xmlns="http://schemas.haulmont.com/cuba/window.xsd" caption="msg://caption" class="com.company.test.web.screens.Screen" messagesPack="com.company.test.web.screens"> <dialogMode height="600" width="800"/> <layout> <accordion id="accTest" width="100%"> <tab id="tab1" caption="Tab 1"> <button id="butTab1" caption="Do something"/> </tab> <tab id="tab2" caption="Tab 2"> <button id="butTab2" caption="Do something too"/> </tab> <tab id="tabSetup" caption="Setup"> <button id="butSetup" caption="Setup something"/> </tab> </accordion> </layout> </window>
When configuring to hide the tab, I have tried these role>UI configurations and assigned them to a test user:
[*] screen: tabSetup -> hide accTest[tabSetup] -> hide accTest.tabSetup -> hide
All without success.
Actually, when using the tabSetup only (or the full path), there was some odd behavior in which the tab (tabSetup) was shown normally but when clicked, it didn’t open and it rather made the content of the tab that was already open to disappear.
Is this a bug or am I doing this the wrong way? any help appreciated.