Forum Discussion
Embed a paginated report with RLS and CUSTOMDATA dataset shows error regarding CSDL.
- 3 years ago
I solved the puzzle. The thing is, if you want to use paginated reports, the dataset can't use RLS. Instead, to achieve RLS-like behavior, you should use the username attribute in the embedToken request and the built-in field 'User!ID' in the report builder expression.
Here's an example of an 'embedToken' request:
Endpoint: https://api.powerbi.com/v1.0/myorg/GenerateToken
{ "datasets": [ { "id": "dataset_with_no_rls_id", "xmlaPermissions": "ReadOnly" } ], "reports": [ { "id": "report_connected_to_dataset_id" } ], "identities": [ { "username": "constraint_value", "reports": [ "report_connected_to_dataset_id" ] } ] }Also, it's important to note that in order to use this approach, you must connect to the dataset using the XMLA endpoint. Otherwise, it won't work.
I solved the puzzle. The thing is, if you want to use paginated reports, the dataset can't use RLS. Instead, to achieve RLS-like behavior, you should use the username attribute in the embedToken request and the built-in field 'User!ID' in the report builder expression.
Here's an example of an 'embedToken' request:
Endpoint: https://api.powerbi.com/v1.0/myorg/GenerateToken
{
"datasets": [
{
"id": "dataset_with_no_rls_id",
"xmlaPermissions": "ReadOnly"
}
],
"reports": [
{
"id": "report_connected_to_dataset_id"
}
],
"identities": [
{
"username": "constraint_value",
"reports": [
"report_connected_to_dataset_id"
]
}
]
}
Also, it's important to note that in order to use this approach, you must connect to the dataset using the XMLA endpoint. Otherwise, it won't work.
This RLS way is not supporters when passing constraints as username while exporting paginated report. I could not found work around for that.