Create a external app with different external app user Hierarchy and different organizations

I wan't to build one big multi page app with different users Hierarchy and organization something like:

Internal user:

  • Admin - can see all , can create new users and new organization
  • Organizations CSM can see all data of each organization assigned to him, and can invite (create new users for each organization. have a all organizations report screen access
  • Organization 1# User under this one can see data and screens related to this Organization only
  • The organization manager can see all data and screens open to this organization. Can manage the user under him
  • Analyst - can see specific data under the organization

Any idea how I can implement that scalability and simple to use?

1 Like

Hello @R_S_I_F ,

To build a scalable, multi-user, multi-organization app in Retool with different user hierarchies, here's a summarized approach:

  1. Database Setup
  • Users Table: Store user roles (Admin, CSM, Organization Manager, Analyst, etc.).
  • Organizations Table: Store organization details.
  • Organization Users Table: Map users to specific organizations and roles.
  1. User Roles and Permissions
  • Admin: Can see all users and organizations, and create new ones.
  • CSM: Can manage and view organizations assigned to them.
  • Organization Manager: Manages data and users within their assigned organization.
  • Analyst: Sees specific data under the organization they belong to
  1. Conditional Visibility
  • Use {{ currentUser.role }} to show/hide UI elements based on user roles.
  • For organization-specific data, use {{ currentUser.organization_id }}.
  1. Dynamic Queries
  • Admins fetch all data: SELECT * FROM organizations.
  • CSMs fetch assigned organizations: SELECT * FROM organizations WHERE csm_id = {{ currentUser.id }}.
  • Organization Managers fetch data for their org: SELECT * FROM data WHERE organization_id = {{ currentUser.organization_id }}.
  • Analysts see specific data within their organization.
  1. User Management
  • CSM/Manager can invite new users, assign them roles, and link them to organizations using forms and queries.
3 Likes

How can i manage the users on the app using this solution ?
What is the auth method?

Hi @R_S_I_F,

While what you are asking for is definitely achievable, it is not necessarily going to be simple. It will likely all need to be done manually by the account admin.

You can create different permissions groups and assign users into the corresponding groups, and control the apps they have access to based on their permission levels as @WidleStudioLLP outlines in their comment.

Hi @R_S_I_F,

Wanted to check in and see if the suggestions from @WidleStudioLLP were able to help you architect out and build out an app for your use case!

I also want to highlight our Retool Developer Network for hiring professional developers approved by Retool to contract out building apps with complex requriements.1