Skip to content

Role-Based Data Security Setup in AIV

Role-Based Data Security Setup in AIV

This guide explains how to configure role-based and user-specific data security in AIV.
With this setup, each user will only see the sales data they are authorized to access.

The examples below use demo users, but you can customize the usernames and roles according to your own requirements.


πŸ“Œ Example Scenario

We have four users, each with different data access levels:

UserAccess Level Description
Demo accessWorks like an admin. Can view and edit all sales data across all countries.
USASees only USA data.
GermanySees only Germany data.
FranceSpainSees France and Spain data only.

⚑ Note: These are demo examples. You can create your own users and apply similar rules for different countries, regions, or departments.


πŸ›  Step 1: Create Users

To create users, follow the official guide:
πŸ‘‰ How to Create a User

For this example, create the following users:

  • Demo access
  • USA
  • Germany
  • FranceSpain

πŸ“Έ Screenshot Placeholder: User Creation Page


πŸ›  Step 2: Create a Role

Next, create a role named Security.
πŸ‘‰ How to Create a Role

πŸ“Έ Screenshot Placeholder: Role Creation Page


πŸ›  Step 3: Assign Role to Users

Now assign the Security role to specific users:

  • USA
  • Germany

πŸ‘‰ How to Assign a Role

Role Assignments:

  • USA β†’ Security role
  • Germany β†’ Security role
  • Demo access β†’ No restriction (sees all data)
  • FranceSpain β†’ Custom query logic (France + Spain data only)

πŸ“Έ Screenshot Placeholder: Assigning Role to Users


πŸ›  Step 4: Configure Dataset with Security Logic

We’ll apply data security at the dataset level.

  1. Open Hamburger Menu β†’ Master Data β†’ Create Dataset.
  2. Select your data source (e.g., training data source connected to a MySQL database).
  3. In the query editor, add security conditions.

πŸ“Έ Screenshot Placeholder: Dataset Creation Screen

Example Query

WHERE 
    {{user}} = 'Demo access'
    OR (
        {{user}} = 'FranceSpain' 
        AND customers.country IN ('France', 'Spain')
    )
    OR customers.country = {{user}}

πŸ‘‰ Alternative (only Demo, USA, Germany):

WHERE 
    {{user}} = 'Demo access'
    OR customers.country = {{user}}

πŸ“Έ Screenshot Placeholder: Query Editor with Security Conditions


πŸ›  Step 5: Set Up Parameters

  1. After writing the query, open the Parameters section.
  2. For the parameter {{user}}, set the Default Value as:
getOwner()

This ensures AIV dynamically uses the logged-in username.
3. Preview your dataset output to confirm filtering is correct.

πŸ“Έ Screenshot Placeholder: Parameter Setup Screen


πŸ›  Step 6: Create Visualization (Viz File)

  1. Go to Dashboard Menu β†’ Create Viz.
  2. Add any chart you need.

πŸ‘‰ Example: A Table Chart with the dataset Sales Security Insights.

  • Select the required columns.
  • Drag and drop them into the table widget.
  • Save your Viz file.

πŸ“Έ Screenshot Placeholder: Viz Creation (Table Chart)


πŸ›  Step 7: Add Viz to Dashboard

  1. Open the Dashboard Grid Menu.
  2. Select your saved Viz file.
  3. Right-click β†’ Share.

πŸ“Έ Screenshot Placeholder: Adding Viz to Dashboard


πŸ›  Step 8: Share with Roles and Users

  1. In the Share Options, you will see all users and roles.
  2. Select the Security role (or your custom role).
    • Example: Security role includes USA and Germany users.
  3. Set Visibility = Public.
  4. Click Share.

πŸ“Έ Screenshot Placeholder: Share Settings Window


πŸ›  Step 9: Test User Logins

  • Demo access β†’ Sees all countries.
  • USA β†’ Sees only USA data.
  • Germany β†’ Sees only Germany data.
  • FranceSpain β†’ Sees only France and Spain data.

πŸ“Έ Screenshot Placeholder: Testing Login with Different Users


πŸ“‚ Dataset Example

Dataset Name: Sales Security Insights

  • Contains sales data with a country column.
  • Data visibility is filtered dynamically based on the logged-in user.

πŸ“Έ Screenshot Placeholder: Example Dataset Output


βœ… Summary

By following these steps, you can:

  • πŸ‘€ Create multiple users.
  • πŸ”‘ Assign roles for security.
  • βš™οΈ Configure datasets with parameters and queries.
  • πŸ”’ Ensure each user only sees authorized data.

This provides a role-based, user-specific data security setup in AIV.