Role Based Product Access (RBAC)

This page explains how to manage user access to products and data within the platform by assigning roles in a multi-tenant environment. Each role determines which products and dashboard metrics a user can see, ensuring secure and personalized experiences.

The RBAC is designed to control visibility of features and data across tenants based on user roles. It ensures users see only the products assigned to their roles, access can vary by tenant (organization), and dashboards and campaign views reflect only the permitted data.

Execute the RBAC Table Scripts

To map user role access, follow the steps below:
  1. Create the following tables for an environment using the create queries:
    1. PBARoleProductMapping:
      CREATE TABLE PBARoleProductMapping  (
       	TenantID INT NOT NULL,
       	RoleID INT NOT NULL ,
       	ProductName TEXT NOT NULL,
       	PRIMARY KEY (TenantID, RoleId)
       );
    2. PBATenantUserRoles :
      CREATE TABLE PBATenantUserRoles (
       	TenantID INT NOT NULL,
       	RoleID INT NOT NULL,
       	RoleName VARCHAR(255) NOT NULL,
       	PRIMARY KEY (TenantID, RoleID)
       );
    3. PBARoleUserMapping:
      CREATE TABLE PBARoleUserMapping (
       	TenantID INT NOT NULL,
       	RoleID INT NOT NULL,
       	UserID INT NOT NULL,
       	PRIMARY KEY (UserId, RoleID )
       );
  2. Define the role in the PBATenantUserRoles table for the tenant.
    insert into PBATenantUserRoles (RoleID, RoleName, TenantID) values (1,"Admin", <TenantID>);
    Note: Replace the <TenantID> with the corresponding value.
  3. Define product labels in the PBARoleProductMapping table for RoleID and TenantID.
    insert into PBARoleProductMapping (RoleID, ProductName, TenantID) values (1,'["HOME LOAN","Credit Card","Credit Upgrade Offer","Credit card"]', <TenantID>);
  4. Assign the role of tenant to a particular user in the PBARoleUserMapping table.
    insert into PBARoleUserMapping (RoleID, UserID, TenantID) values (1,3724, <TenantID>);