I have downloaded App Owns Data from github - https://github.com/Microsoft/PowerBI-Developer-Samples. I have added Row Level Security by adding the following line:
generateTokenRequestParameters = new GenerateTokenRequest("View", null,
identities: new List<EffectiveIdentity>{new EffectiveIdentity(username: "username", roles: new List<string> { "Role A"}, datasets: new List<string> { report.DatasetId })});
Currently, I can add only one username at a time. Is there any way using which I can multiple users and assign different roles to them? Any help is appreciated!
You need to add row level security by adding roles in power bi desktop -
Adding multiple usernames to the GenerateTokenRequest would be counter intuitive as it is designed to generate a token for a single user viewing the embedded report.
If you have different usernames in different tables for the same user then you could create a look up table where usernameA maps to username1 on table1, username2 on table 2 etc.
If you can provide more details on your use case I'd be happy to try and help