Forum Discussion
Row level security with multiple roles
Hi Pallavi,
It seems your embedded mode is "App Owns Data". Please refer to developer/embedded-row-level-security.
1. I would suggest you create two roles based on locationid and clientid. One role is also good if the two fields can be combined.
{
"accessLevel": "View",
"identities": [
{
"username": "EffectiveIdentity",
"roles": [ "Role1", "Role2" ],
"datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
}
]
}
2. If not for the sake of security, I would suggest you use slicers to make the two fields dynamic.
Best Regards,
Dale
Thank you v-jiascu-msft.
Currently, for generatingtoken with single role i am passing the post request body as
$clientid = "2";
{
"accessLevel": "View",
"identities": [
{
"username": $clientid ,
"roles": [ "Client" ],
"datasets": [ "9b61d620-e6ac-41fc-b2c9-3f1d89241a03" ]
}
]
}
Another field that comes in now is
$location = "3";//Can be multiple location under client
Note: I may have multiple location under single client [under client 2 i may have location id 2,3,4 etc] and i have 2 different table called Clients and Locations.
In Bi desktop i have Client role created as client_id = USERNAME(); (I have duplicated client id column as string)
How i can pass the location for username property of identities, where it takes single value?
What can be done at the power bi desktop to create the roles for both clients and locations ?
Thanks and regards
Pallavi
- v-jiascu-msft8 years agoMicrosoft Employee
Hi Pallavi,
We can set many rules for one role at the same time. So we can only create one role for your scenario. Please refer to the snapshot below.
Best Regards,
Dale
- v-jiascu-msft8 years agoMicrosoft Employee
- PallaviKGVG8 years agoHelper I
Hi v-jiascu-msft,
The issue is no yet solved.
I need to get a report as such where client_id = 2 and location_id =1 (Single client may have different locations). When i want to render a report , where the location_id is only 1.
reffer image for the relationship.
So, How i can achive that?
The client and locationid can be dynamic. As 'username' in identities takes only single value where can i pass location_id like just 1?.
How my role level security created at the desktop?
In the above solution, when i create the role as such, i wil get a report for that particular client and all locations under that client. But, in this case i need a single location that is under client, i mean to say that location id and client id is send to the api at the time of embedding in the webapplication.
something like this ?
$clientid = "2";
{
"accessLevel": "View",
"identities": [
{
"username": $clientid ,$location_id
"roles": [ "Client","Location" ],
"datasets": [ "9b61d620-e6ac-41fc-b2c9-3f1d89241a03" ]
}
]
}If their is something to solve this issue is very helpfull.
Thank you
Pallavi
- PallaviKGVG8 years agoHelper I
Hi, any updates on the above issue:smileysad:
Thank you
Pallavi
