on 11-23-2015 10:58 AM
Hello,
We have installed BI41 sp4 with tomcat as the application server.
I also have installed BI41 sp4 .NET package with dll’s.
I have a running Visual Studio application (.NET) which I want to extend with
listing the applied groups set on different folders
with their access levels ( full control, no access, advanced).
I tried to do this first with CrystalDecisions.Enterprise.* references.
I couldn't find a security class.
Then I tried to do this with DSWS dll’s but I didn’t succeed because a method used in example SAP note 1385000 is deprecated.
I couldn't find any document for BI4.1 .NET SDK programming.
Can somebody give me an example how to list the used groups on a folder with its access level?
Thanks in advance.
Regards
Joek poort
Documentation is available in the Developer Information section at http://help.sap.com/bobip. However, the .NET documentation is not very good and they've finally taken down the old BusinessObjects (pre-SAP) documentation site that had better documentation.
I don't have any sample code, but this is not very difficult to do.
1. Log in to the system (there's code for this in the sample files available on the homepage of this space.)
2. Query the CMS database for the folder(s) you want to check. This is something like:
Select * from CI_INFOOBJECTS where SI_KIND = 'Folder'
3. For each of the folder, get the SecurityInfo2 object. You can then walk through the ExplicitPrincipals to get the groups/users that have been explicitly assigned access and the EffectivePrincipals to get the groups/users who have inherited rights. For ExplicitPrincipals, you'll use the ExplicitRoles to determine the type of access and for EffectivePrincipals, you'll use the EffictiveRoles to get it.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
Regards
Joek Poort
Message was edited by: Ludek Uher
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.