Skip to Content
0
Former Member
Mar 10, 2009 at 06:33 PM

Trying to get the security information for objects

111 Views

I am trying to get the security information for objects (in this case Report Folders)

I build a query such as:

Note (the boSessionAsSDK is already established)

                string[] biPlatformURL = boSessionAsSDK.GetAssociatedServicesURL("BIPlatform");
                BusinessObjects.DSWS.BIPlatform.BIPlatform boBIPlatform = BusinessObjects.DSWS.BIPlatform.BIPlatform.GetInstance(boSessionAsSDK, biPlatformURL[0]);

                string query = "query://{Select TOP 50000 SI_CUID, SI_NAME, SI_DESCRIPTION, SI_CHILDREN, SI_FILES FROM CI_INFOOBJECTS " +
                                "WHERE SI_PROGID = 'CrystalEnterprise.Folder' ";

                if (area != string.Empty)
                {
                    query += "AND SI_NAME LIKE '" + area + "' ";
                }

                query += "Order By SI_NAME}";

                GetOptions opts = new GetOptions();
                opts.IncludeSecurity = true;

                ResponseHolder boResponseHolder = boBIPlatform.Get(query, opts);

                if (boResponseHolder != null && boResponseHolder.InfoObjects != null && boResponseHolder.InfoObjects.InfoObject != null)
                {
                    for (int ndxFolder = 0; ndxFolder < boResponseHolder.InfoObjects.InfoObject.Length; ndxFolder++)
                    {
                        //build the dataset to return based on the SDK objects
                        BusinessObjects.DSWS.BIPlatform.Desktop.Folder folder = (boResponseHolder.InfoObjects.InfoObject[ndxFolder] as BusinessObjects.DSWS.BIPlatform.Desktop.Folder);

The query returns fine, and I can see the data about the folder, but when I later try to referenece the securtiy info like:

  for (int ndxPrincipals = 0; ndxPrincipals < folder.SecurityInfo.Principal.Length; ndxPrincipals++)
    {
       BusinessObjects.DSWS.BIPlatform.Desktop.Principal principal = folder.SecurityInfo.Principal[ndxPrincipals];

SecurityInfo is null.

I've stopped in the debugger, after the query completes, and no matter what object level I look at .SecurityInfo it is always null. I thought that was what the GetOptions was for.

Do I need to set an option somewhere else? If it's easier, if you can provide a simple example that works then I can apply it to my code.

Doing some experimenting, I also tried:

    RightInfo[] test = boBIPlatform.GetKnownRights(folder.CUID);

This threw an exception " An XSD Exception occurred. The kind 'Note' does not exist in the CMS. (FWM 04030) (WBP 42029)"

I also saw this if I tried:

    GetOptions opts = new GetOptions();
    opts.IncludeSecuritySpecified = true;