Manage client access to modules in multi-tenant application environment

I am developing a full ERP system in CUBA platform. It is quite some time now and almost ready to hit the market in near future. I am considering multi-tenant deployment in the cloud and here is the use case I am thinking of!

There are many modules exist as usual (see list below). My clients (customers) will have the option to subscribe for one or multiple modules and there will be a Global admin table where the modules subscribed for per client will be maintained. One of the solution approaches could be as follows:

Hide the modules (each module has a root menu under the main application menu as below) in user access administration for which the client has not subscribed for. i.e. the client Admin will not even see those modules for which the client has not subscribed for. Alternatively, it can be inactivated if the first option is not viable. Menus are also hidden from SideMenu Search component accordingly.

Here is the menu I want to control from Global admin as an example:
17%20PM

Thanks for any suggestions.

Hi Mortoza,

So what is your question? How to hide some menu items programmatically in the main menu and role permissions?

Regards,
Konstantin

1 Like

Hi Konstantin
Yes, you got it!

To hide menu programmatically, it works already. How can I do the same for the client admin in role setups? I want some menu items be hidden even for the client admin based on the modules subscribed for.

You can try to redefine the com.haulmont.cuba.gui.config.PermissionConfig bean in your project. This bean provides lists of permission targets to the role editor screen. See getScreens/getEntities/getEntityAttributes/getSpecific bean methods.

Thank you Konstantin for the hints that sounds very good.

regards
Mortoza