I would like to configure the web client such that if a specific user logs in, I want to use one Main Window (like an Admin screen), otherwise they will get a default Main Window. The default Main Window does NOT have a work area as I need the whole screen for my app but the Admin screen will be a typical Cuba screen with the menu and work area. Can this be done and if so, how do I configure this ?
You may also create a grid or something which is visible
Based on Spesific permissions.
You can use Secure.isSpesificPermission to control user access from Roles
Role can be assigned to users.
OK. I understand. Looks like I CANNOT have 2 Main Windows in CUBA but I can manipulate the single Main Window to show/hide or enable/disable the AppMenu and Main Workarea and my customized screens.
You can use multiple main windows in CUBA 6.3.RC2+, but support for this feature in Studio is limited. You cannot create multiple main windows from Studio, but it can be done manually from an IDE.
Steps to implement multiple main windows:
Create App class in web module package “com.company.demo.web” (for example) if you project does not have it.
App class should extend DefaultApp class from CUBA. Here we override CUBA 6.3 method “routeTopLevelWindowId”. It returns id of main window that should be shown for currently logged in user.
For instance, here I check user session attribute “main-window” and show two different windows: “mainWindow” and “mainWindow2”.
Now, if I add security attribute to Company group with name “main-window” and value “manager” then users in this group will see “mainWindow” otherwise “mainWindow2”.
I’ve added sample project; you can try this approach in action. Note: this functionality is not yet documented and available only in 6.3 versions.