Add variable In Filter Permission

This feature allows admins or analysts to add variable {{ $user.email }} in filter permission.

Consider a company where 50 managers manage 100 different stores. Each manager can only see the stores' reports he/she manages. When managers switch stores, the admins will need to update the changes in their own system and update the permissions in Holistics system. With this feature, they only need to do that on their own system.

Consider these tables:

managers
ID Email
1 [email protected]
2 [email protected]
3 [email protected]
stores
Store ID Name
1 Girls and Boys
2 French Macaron
3 Fashion Factory
store_user_permissions
Store ID User ID
1 1
1 2
2 1


They can create a filter permission as such:

permissions:
- if_group: Manager
  then_sql:
    ds_id: 25
    query: select store_id from store_user_permissions SUP join managers M ON SUP.user_id = M.id where M.email = {{ $user.email }}

Notes: