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:
ID | |
---|---|
1 | [email protected] |
2 | [email protected] |
3 | [email protected] |
Store ID | Name |
---|---|
1 | Girls and Boys |
2 | French Macaron |
3 | Fashion Factory |
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:
- This can only be used for dropdown filter and text filter.
- This cannot be used in legacy syntax.
- Right now, we support variable
$user.email
only.