Hi @anya.conti
Context
If I understand your situation correctly:
- You have an embedded dashboard built on multiple datasets.
- Row-level permissions need to be set for each dataset manually in the embed payload, which can be cumbersome and prone to errors.
And the problem youâre facing:
- Itâs hard to manage and easy to misconfigure permissions, especially with multiple datasets.
Potential Solution:
Weâre exploring a potentially more streamlined approach that could simplify your workflow in the future, using user_attribute
defined in Holistics.
The main idea is to move Row-level Permissions to the Modeling (As-code) layer. This will make them easier to maintain and ensure consistency, instead of requiring manual configuration through Embed Payload.
Hereâs an overview of how it could work:
(1) Create a User Attribute in Holistics
First, define the user attribute in Holistics through the User Management section.
For more details, please refer to our documentation.
(2) Define Row-Level Permissions in Holistics As-Code
Instead of setting permissions in the embed payload for each dataset, define them directly in Holistics. For example:
Dataset first_dset {
always_filters: {
filter1 Filter {
field: ref('continent_codes', 'code')
enabled: true
default {
operator: 'is'
value: ['asia']
}
}
filter2 Filter {
field: ref('users', 'email')
enabled: H.current_user.is_biz_user // use UserAttribute here
default {
operator: 'is'
value: H.current_user.email // use UserAttribute here
}
}
}
}
Dataset second_dset {
always_filters: {
filter1 Filter {
field: ref('continent_codes', 'code')
enabled: true
default {
operator: 'is'
value: ['eu']
}
}
filter2 Filter {
field: ref('users', 'email')
enabled: H.current_user.is_biz_user // use UserAttribute here
default {
operator: 'is'
value: H.current_user.email // use UserAttribute here
}
}
}
}
By defining row-level permissions in the modeling layer, you would ensure they are consistently applied across all datasets.
Noteâ: The syntax provided above is a preliminary draft from our design document. The final version may vary.
(3) Use User Attributes in Embed Payload
You can then pass the values to user_attribute
in your embed payload. Hereâs an example:
// Embedded payload
embedded_payload = {
permissions: {},
user_attribute: {
is_biz_user: true,
email: '[email protected]'
}
}
This way, you wonât have to manually configure row-level permissions for each dataset via embed payload, reducing the risk of errors.
For more information, you can refer to this doc
We would love to hear your thoughts or any suggestions you might have. What do you think about this potential approach? Your feedback would be invaluable as we consider implementing this feature.