Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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" ] } ] }
Hi @Anonymous,
Please mark the private information.
May I ask if it's necessary to use two conditions? You can do it in the local application. For example, even if there are two users have same userID, the pseudo-code is as below.
if TenantID = "T001" && UserID = "Nilesh" then { "accessLevel": "View", "identities": [ { "username": "Nilesh", "roles": [ "Role1", "Role2" ], "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ] } ] } else if TenantID = "T002" && UserID = "Nilesh" then { "accessLevel": "View", "identities": [ { "username": "Nilesh", "roles": [ "Role3", "Role4", "Role5" ], "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ] } ] }
Finally, different users get different tokens.
Reference: embedded-row-level-security#applying-user-and-role-to-an-embed-token
Best Regards,
Dale
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |