I have a Azure Synapse SQL table which contains a list of companies.
I have created an access matrix, security predicate and policy to filter data presented based on the user.
Create FUNCTION spf.rls_securitypredicate_dimcompany(@Companycode AS nvarchar(50))
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN SELECT 1 AS tvf_securitypredicate_result
From dwh.dimCompany a
Join spf.AccessMatrix b on a.companycode = b.companycode
Where (a.CompanyCode = @Companycode
and
b.emailaddress = USER_NAME()
)
This works fine as when someone executes a query on this dataset it only presents data relevant to their login.
I’ve published a PowerBI Dashboard to a shared workspace and RLS has been applied as per my login and not the user viewing the PBI report.
Is there a way of inheriting the RLS from Synapse to PBI or would i have to recreate the RLS feature in PBI?
2
Answers
The solution will depend on whether DirectQuery is being used or data is being imported.
Refer – Row-level security (RLS) with Power BI
And in Import mode you can apply compatible RLS by importing the AccessMatrix table and using it in Power BI Dynamic Row-Level security. So Power BI would be enforcing the RLS based on the data entitlement data stored in Synapse.