public AclPackage GetOwnerPrivateAcls(String ownerName, String repository) { // instantiate a Query service proxy ServiceFactory serviceFactory = ServiceFactory.Instance; IQueryService queryService = null; queryService = serviceFactory.GetRemoteService <IQueryService>(accessControlService.GetServiceContext()); // build and run the query PassthroughQuery query = new PassthroughQuery(); query.QueryString = "select owner_name, object_name from dm_acl " + "where r_is_internal='0' and acl_class='0' and owner_name='" + ownerName + "'"; query.AddRepository(DefaultRepository); QueryExecution queryEx = new QueryExecution(); queryEx.CacheStrategyType = CacheStrategyType.DEFAULT_CACHE_STRATEGY; queryEx.MaxResultCount = -1; // no limit OperationOptions operationOptions = null; QueryResult queryResult = queryService.Execute(query, queryEx, operationOptions); DataPackage resultDp = queryResult.DataPackage; List <DataObject> dataObjects = resultDp.DataObjects; Console.WriteLine("Total objects returned is: " + dataObjects.Count); //convert the results into a List<AclIdentity> List <AclIdentity> identityList = new List <AclIdentity>(); foreach (DataObject dObj in dataObjects) { PropertySet docProperties = dObj.Properties; AclIdentity aclIdentity = new AclIdentity(); aclIdentity.Domain = docProperties.Get("owner_name").GetValueAsString(); aclIdentity.Name = docProperties.Get("object_name").GetValueAsString(); aclIdentity.RepositoryName = repository; identityList.Add(aclIdentity); } // get and return the AclPackage return(accessControlService.Get(identityList)); }