Provides data access to a SharePoint site collection.
Data access to the site collecion is performed using the SharePoint web services because this avoids having to grant the SharePoint search crawl account access permissions on the content database.
        protected List <SpUserDetail> GetAllowedUsers(string mapDatabaseName, string repositoryName, Guid domainId, Guid rootMapId)
        {
            List <SpUserDetail> allowedUsers = new List <SpUserDetail>();

            // Get the non-admninistrator users defined in the security database.
            List <SpFarmGroupIdentifier> allowedGroupIdentifiers = _securityRepository.GetAllowedGroups(repositoryName, domainId, rootMapId);

            foreach (SpFarmGroupIdentifier groupIdentifier in allowedGroupIdentifiers)
            {
                try
                {
                    SpSiteCollectionRepository        siteCollectionRepository = new SpSiteCollectionRepository(groupIdentifier.SiteCollectionId);
                    Dictionary <string, SpUserDetail> users = siteCollectionRepository.GetUsersInGroup(groupIdentifier.GroupId);
                    allowedUsers = allowedUsers.Union(users.Values).ToList();
                }
                catch (FileNotFoundException currentException)
                {
                    GlymaSearchLogger.WriteTrace(LogCategoryId.Security, TraceSeverity.Medium, "Unable to connect to the site collection with ID, " + groupIdentifier.SiteCollectionId + " : " + currentException.ToString());
                }
            }

            // Get the administators for the site collections that are associated with the map database.
            List <Guid> siteCollectionIds = _securityRepository.GetSiteCollectionAssociations(mapDatabaseName);

            foreach (Guid siteCollectionId in siteCollectionIds)
            {
                try
                {
                    SpSiteCollectionRepository        siteCollectionRepository     = new SpSiteCollectionRepository(siteCollectionId);
                    Dictionary <string, SpUserDetail> siteCollectionAdministrators = siteCollectionRepository.GetSiteCollectionAdministrators();
                    allowedUsers = allowedUsers.Union(siteCollectionAdministrators.Values).ToList();
                }
                catch (FileNotFoundException currentException)
                {
                    GlymaSearchLogger.WriteTrace(LogCategoryId.Security, TraceSeverity.Medium, "Unable to connect to the site collection with ID, " + siteCollectionId + " : " + currentException.ToString());
                }
            }

            return(allowedUsers);
        }
      protected List<SpUserDetail> GetAllowedUsers(string mapDatabaseName, string repositoryName, Guid domainId, Guid rootMapId)
      {
         List<SpUserDetail> allowedUsers = new List<SpUserDetail>();

         // Get the non-admninistrator users defined in the security database.
         List<SpFarmGroupIdentifier> allowedGroupIdentifiers = _securityRepository.GetAllowedGroups(repositoryName, domainId, rootMapId);
         foreach (SpFarmGroupIdentifier groupIdentifier in allowedGroupIdentifiers)
         {
            try
            {
               SpSiteCollectionRepository siteCollectionRepository = new SpSiteCollectionRepository(groupIdentifier.SiteCollectionId);
               Dictionary<string, SpUserDetail> users = siteCollectionRepository.GetUsersInGroup(groupIdentifier.GroupId);
               allowedUsers = allowedUsers.Union(users.Values).ToList();
            }
            catch (FileNotFoundException currentException)
            {
               GlymaSearchLogger.WriteTrace(LogCategoryId.Security, TraceSeverity.Medium, "Unable to connect to the site collection with ID, " + groupIdentifier.SiteCollectionId + " : " + currentException.ToString());
            }
         }

         // Get the administators for the site collections that are associated with the map database.
         List<Guid> siteCollectionIds = _securityRepository.GetSiteCollectionAssociations(mapDatabaseName);
         foreach (Guid siteCollectionId in siteCollectionIds)
         {
            try
            {
               SpSiteCollectionRepository siteCollectionRepository = new SpSiteCollectionRepository(siteCollectionId);
               Dictionary<string, SpUserDetail> siteCollectionAdministrators = siteCollectionRepository.GetSiteCollectionAdministrators();
               allowedUsers = allowedUsers.Union(siteCollectionAdministrators.Values).ToList();
            }
            catch (FileNotFoundException currentException)
            {
               GlymaSearchLogger.WriteTrace(LogCategoryId.Security, TraceSeverity.Medium, "Unable to connect to the site collection with ID, " + siteCollectionId + " : " + currentException.ToString());
            }
         }

         return allowedUsers;
      }