Hello Dell,
Thanks for your quick response.
I understand your suggestions but for me your remarks are easier said than done.
You mention ExplicitPrincip[als and EffectivePrincipals. I tried to follow your suggestions and have tried a lot
but in summary the following:
I work in environment BI41 sp4.The code I used is the following with remarks.
First: I have a working Infoobject
string strQuery2 = "select * from CI_INFOOBJECTS
where SI_ID = 228762"; //228762 = folder with name aatest
InfoObjects folders = infoStore.Query(strQuery2);
InfoObject folder = infoStore.Query(strQuery2)[1]; //I see the
folder
SecurityInfo2 securityInfo2 = folder.SecurityInfo2;
EffectivePrincipals effectivePrincipals =
securityInfo2.EffectivePrincipals;
EffectivePrincipal effectivePrincipal =
effectivePrincipals[1]; //I seegroup everybody
EffectiveRights effectiveRights =
effectivePrincipal.Rights;
ExplicitPrincipals explicitPrincipals =
securityInfo2.ExplicitPrincipals;
ExplicitPrincipal explicitPrincipal =
explicitPrincipals[1]; //I see group everybody
ExplicitRoles explicitRoles =
explicitPrincipal.Roles; // explicitRoles threw an exception so I couldn’t use it
string explicitprincipalname = explicitPrincipal.Name;
//list access level for group on folder with explicitPrincipals
string access_level2 = "";
for
(int i = 1; i <= explicitRoles.Count; i++)
{
access_level2 = explicitRoles[i].ToString();
Console.WriteLine("access_level " + access_level2);
}
//list groups on folder with effectivePrincipals
string Group = "";
string GroupName = "";
for
(int i = 1; i <= effectivePrincipals.Count;i++)
{
Group = effectivePrincipals[i].ToString(); //this gives me effectivePrincipals
//I see name of group when I debug but cann't retrieve it with Properties. How can
I achieve this?
//GroupName = Group.Properties["SI_NAME"].ToString();
Console.WriteLine("group " + Group);
effectivePrincipal = effectivePrincipals[i];
effectiveRights = effectivePrincipal.Rights;
//I try to Get access level for each principal (=Group)
//Below doesn't work.
//Please give me working code????
string access_level = "";
for (int j = 1; j <= effectiveRights.Count; j++)
// access_level = effectiveRights[j].ToString(); // I
cann't use [j] so how to get each right
access_level = effectiveRights.ToString();
Console.WriteLine("access_level" + access_level);
}
So you see I struggle.
Can you please give me more exact code?
My mailadress is joek.poort@radboudumc.nl is you want to mail me.
Regards
Joek Poort