Forum Discussion
Power BI Embedded Row-Level Security for Multiple values of single attribute
Hello,
There is no need to manage any OR conditions as that is why you have the Roles_Departments mapping table there for.
E.g. Your Roles_Departments mapping tables might have values like -
Role_Id | Department_Id
R1 | D1
R1 | D2
R2 | D3
R3 | D2
R3 | D3
Now, if you pass the particular Role_Id you need via USERNAME(), the related departments will get filtered which will inturn all the related tables showing data only related to those filtered departments.
Hope, this will give you more clarity. If you still have any query, please do write back.
I have one table where I have to check two roles. One is "TenantID" and User Level. Can you please help with this.
TenantID = username() && User Level = username()
Above this, I set the roles?
Report should be filtered via Tenant and then user level role.
Please let me know how to call this role in embedded code
var generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: "username", roles: new List<string> { "roleA", "roleB" }, datasets: new List<string> { "datasetId" }) });
var tokenResponse = await client.Reports.GenerateTokenInGroupAsync("groupId", "reportId", generateTokenRequestParameters);
or
{ "accessLevel": "View", "identities": [ { "username": "EffectiveIdentity", "roles": [ "Role1", "Role2" ], "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ] } ] }
- vinaypugalia8 years agoResolver I
Hello Mayank,
You can probably, create a computed column which is a combination of TenantId & User Level. Once this is done, you can then pass appropriate value in the UserName(), which can then be used to apply the rule on the newly created computed column.
Hope, this helps!