Forum Discussion
santiagomur
5 years agoResolver II
RLS LIVE CONNECTION
Hi, i have a problem with the config of the rls, i already use rls and it works fine, but now the plan is to make 1 dataset and many reports, i try to use the same config that i use when is 1 r...
nickyvv
5 years agoMost Valuable Professional
Hi santiagomur.
I see a lot of code, but I'm not sure where to look at? What exactly is the issue? Is there an error, or is RLS not working?
Please be as specific as you can when describing the problem, that helps us to understand it better.
santiagomur
5 years agoResolver II
Hi,
when i use this config on a normal 1 to 1 report dataset is fine, but now i try many report to one dataset and the rls dont works.
string allParameter = String.Concat(userData.userID,";",userData.companyY2MX,";",userData.environment,";",userData.mediatorCode,";",userData.commercialCode);
log.Info("allParameter: " + allParameter);
result = new EmbedConfig { Username = allParameter, Roles = userData.roles};
var datasets = await client.Datasets.GetDatasetByIdInGroupAsync(userData.groupId, report.DatasetId);
log.Info("DataSet: " + report.DatasetId);
result.IsEffectiveIdentityRequired = datasets.IsEffectiveIdentityRequired;
result.IsEffectiveIdentityRolesRequired = datasets.IsEffectiveIdentityRolesRequired;
log.Info("Dataset IsEffectiveIdentityRequired: " + result.IsEffectiveIdentityRequired);
log.Info("Dataset IsEffectiveIdentityRolesRequired: " + result.IsEffectiveIdentityRolesRequired);
//GenerateTokenRequest generateTokenRequestParameters;
log.Info ("Llega3");
if (!string.IsNullOrWhiteSpace(userData.userID))
{
if (result.IsEffectiveIdentityRolesRequired==true)
{
var rls = new EffectiveIdentity(allParameter, new List<string> { report.DatasetId });
if (!string.IsNullOrWhiteSpace(userData.roles))
{
var rolesList = new List<string>();
rolesList.AddRange(userData.roles.Split(','));
rls.Roles = rolesList;
}
// Generate Embed Token with effective identities.
generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view", identities: new List<EffectiveIdentity> { rls });
log.Info("Token Request with EffectiveIdentity");
}