looking for example of multi-tenant app

0
Multi-tenancy is a canonical use-case for SaaS applications. Are there example apps or tutorials on this subject one can learn from? The "multi-tenant administration" module, once loaded in the modeler, produces numerous errors about components no longer being available. The "multi-tenancy" documentation seems detailed but is not cohesive in describing how to set this up. I think having a multi-tenant sample app, where the underlying functionality is simple but the users are tenants within orgs, would be a very useful example to showcase. Any help appreciated, thanks GK  
asked
7 answers
1

GK,

I happen to have a simple app with Multi-Tenant module included and the errors eliminated.  You can grab the project package here.  Once you've downloaded it, open Modeler 7.18.1 and choose Import Project Package from the File menu.

Hope that helps,

Mike

answered
0

Hi GK,

Here is a how to guide for setting up the Multi-tenant administration module.

https://docs.mendix.com/howto/security/set-up-your-first-multi-tenant-app

 

edit: The errors have to do with the layouts in the module not being available in the project. An easy way to fix this is to add a module called "NavigationLayouts" (caps sensitive), go to the atlas_UI_resources module and in _Layouts folder go to Responsive, and then right click > duplicate the Atlas_Default layout. Then drag the duplicated layout to your NavigationLayouts module and rename it to "Sidebar_Full_Responsive". Then you will get a pop up showing that the modeler found matches for this layout and click continue. 

Do the same for the pop up layout in the atlas ui module. Duplicate it and move it to the navigations layout module. Then rename it to "PopupLayout".

Once you do all that, there will be a few more errors. To resolve them you have to move the content that is floating on the top on paste it in the main area. 

For this page, move the snippet into the main area, and then delete the red context box after. Do that for all errors and you should be good to go.

 

 

edit 2: The create button most likely isnt showing up because of security. I would make sure you are using an account with the administrator module role. In the project module go to security > User roles and then click on the administrator role. Click edit module roles and add the administrator module role from the multi tennant module. 

answered
0

Appreciate the guidance on this, I installed the module from Mike (see above) and can see the additional structures added but cannot see how to create a tenant (an tenant organization) with users specific to it and then login with a tenant user and see that they are scoped to their org.

What I would expect to see is:

- an administrative way to add tenants (organizations), and that is there with this module (see below)

- a way to add users to a tenant, but there's no "New" or "Add" in the tenant users screen (see below)

- a newly added user could then login and be scoped to the org (some value in their tenant attributes)

Further guidance appreciated.

GK

answered
0

Austin, I've made sure the security settings are setup for Admin, per your remarks.

Still, no way of adding a user to a tenant...

answered
0

Thanks for the tip Austin, turns out the multi-tenancy module didn't provide the Administrator role with access to CreateTenant microflows, which caused the "New" button to be invisible.

 

So I create a user but it doesn't seem to be associated with a tenant.

My assumption with a multi-tenancy system is users belong to [one] tenant (organization), to which they are scoped.

For example:

Organization (tenant): Acme Corp

                             User:  Billy Bob

 

Organization (tenant): XYZ LLC

                             User:  Jane Doe

 

So Billy sees data in the scope of Acme Corp but not any other tenant.

 

What am I missing? Thanks

 

 

answered
0

So I've created Tenant Users in this multi-tenant app. Ty Mike and Austin.

Now this is likely a simple question: I want to display the User Name and Tenant Name in the home screen, just to visually confirm their tenancy.

Getting an error that the page is expecting an object of the type 'TenantUser'. I assumed (incorrectly) that System.User was available to any/all screens for a logged-in user. How do I load this object in context given a logged in user?

 

answered
0

solution is here: https://forum.mendix.com/link/questions/91629

answered