Created on 30 January 2020
icon_unfollowing
Login to follow
multitenant-with-custom-user-provider

MultiTenant Example

Stable version 1.0.2 (Compatible with OutSystems 11)
Uploaded on 09 February 2020 by 
multitenant-with-custom-user-provider

MultiTenant Example

Documentation
1.0.2

NOTE: This Application is for demonstration purpose only and you might not be able to install it in personal environment as it has a module which is also a user provider.

This Application has four modules

  1. BO: Back Office module used to create tenant and also for managing user against a tenant. This module has below pages

    1. Tenants: Tenants page is the landing page of this module. This page provides a dropdown with all the user provider eSpace and table which displays the tenants created against that user provider. By default a Users tenant is always found under Users user providers.

    2. TenantAdd: This page provides a popup to take a tenant name as input and creates the tenant with the provided name under selected user provider

    3. Tenant: This page display all the users present against the selected tenant and also provides an option to create new user.

    4. Tenant_User_PopupEditor: This page provide a form to create user under the selected tenant.

  2. Contacts_CustomUser: Contact application, this application is based on "CustomUsers" user provider, so any user part of CustomUsers module can access this application.

    1. Contacts: This page displays all the contacts created under the logged in user tenant. This also provides ability to edit/create a contact.

    2. ContactDetail: This page provides a form for creating a contact.

  3. Contacts_users: Contact application, this application is based on "users" user provider, so any user part of users module can access this application.

    1. Contacts: This page displays all the contacts created under the logged in user tenant. This also provides ability to edit/create a contact.

    2. ContactDetail: This page provides a form for creating a contact.

  4. CustomUsers: Custom User provider, this is a copy of old version of users module. This module was found in post https://www.outsystems.com/forums/discussion/26457/user-provider-module/

All the module work together and provides a playground to help understand how tenant can be mapped to a user provider and how an multi tenant application (contact) can be created. To get most of it I recommend performing below steps

  1. Turn the debug on and put breakpoint on action which you want to understand
  2. Navigate to BO module in browser.
  3. Create two tenant under Users and CustomUsers user provider (For example UserTeanant1, UserTeanant2, CustomUserTenant1, CustomUserTenant2 ). Steps to create a tenant is as below
    1. Click on Add Tenant link
    2. In the popup provide a name without any space and click on create
  4. Create on at least one user against each tenant (for example UserTeanant1 against UserTeanant1 tenant, UserTeanant2 against UserTeanant2 tenant, CustomUserTenant1 against CustomUserTenant1 tenant, CustomUserTenant2 against CustomUserTenant2 tenant). Below is the step to create a user
    1. Click on the tenant name against which you want to create a user
    2. Click on the "New User" link.
    3. In the popup fill the form and click on save.
    4. Click on the application name to navigate back to tenants page.
  5. Now navigate to Contacts_users module
  6. Login with the user1 (UserTeanant1)
  7. Create a new contact as below
    1. Click on "Create a new Contact" link
    2. in the ContactDetail page, fill the form and click on save
  8. Logout
  9. Login as User2 (UserTeanant2) and you will notice the contact created by UserTeanant1 is not visible to UserTeanant2
  10. Create a new contact as below
    1. Click on "Create a new Contact" link
    2. in the ContactDetail page, fill the form and click on save
  11. Now navigate to Contacts_CustomUser module
  12. Try logging as user from users provider (UserTeanant1)
  13. Now try logging in as user1 from CustomUser provider (CustomUserTenant1)
  14. Create a new contact as below
    1. Click on "Create a new Contact" link
    2. in the ContactDetail page, fill the form and click on save
  15. Logout
  16. Login as User2 (CustomUserTenant2) and you will notice the contact created by CustomUserTenant1 is not visible to CustomUserTenant2
  17. Create a new contact as below
    1. Click on "Create a new Contact" link
    2. in the ContactDetail page, fill the form and click on save

Additionally try creating a same username against all the tenants and see how the application behaves.


Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
MultiTenant Example has no dependencies.