Eoghan Bonass
01/10/2024, 10:32 AMuser_id
to restrict the content visible for the current user
Challenge
1. All the data entities (tables & views) in the LDM would need to be filtered by user_id
2. We’ve tried adding lookup tables with user_id
column that are linked/related to the target entity, e.g. if we had a sales
table with sales_id
and other columns, it would have a corresponding sales_lookup
table linked on sales_id
that lists each user_id
for each sales_id
- but the target sales
table does not have the user_id
◦ This approach was intended to keep the ‘business entity’ tables in the same shape, but permit filtering by the user_id
◦ The problem is that the filter only works when an insight includes the user_id
, which we of course can’t enforce
3. Our alternative approach is to create views of the business entities that do include the user_id
, effectively repeating the sales_id
and other columns for every user that has access to that row
Right now we can’t see how we could make the lookup table approach in point 2 above work. Do the GoodData team know of any way we can force the generated queries to always consider/apply the user filter, even if the user hasn’t added the corresponding column to an insight?
Otherwise, is there a different approach we should or could consider other than point 3 above?
All thoughts and suggestions welcome!Ivana Gasparekova
01/10/2024, 11:00 AMEoghan Bonass
01/10/2024, 11:17 AMEoghan Bonass
01/10/2024, 11:18 AMIvana Gasparekova
01/10/2024, 11:21 AMEoghan Bonass
01/10/2024, 11:23 AM{
"data": {
"id": "project_lookup_filter",
"type": "userDataFilter",
"attributes": {
"title": "Project Lookup filter",
"maql": "{label/project_lookup.user_id} = \"<user_id_value>\""
}
}
}
Eoghan Bonass
01/10/2024, 11:24 AMIvana Gasparekova
01/10/2024, 12:57 PM