public WindowsGlymaSecurityManager(IGlymaSecurityRepository securityRepository, TimeSpan autoExpireItemsPeriod, int maxItems, TimeSpan nodeAclCacheDuration, TimeSpan nodeAclTaskWaitDuration)
 {
    _isCacheEnabled = true;
    _securityRepository = securityRepository;
    AutoExpireItemsPeriod = autoExpireItemsPeriod;
    MaxItems = maxItems;
    CacheDuration = nodeAclCacheDuration;
    TaskWaitDuration = nodeAclTaskWaitDuration;
 }
 public WindowsGlymaSecurityManager(IGlymaSecurityRepository securityRepository, TimeSpan autoExpireItemsPeriod, int maxItems, TimeSpan nodeAclCacheDuration, TimeSpan nodeAclTaskWaitDuration)
 {
     _isCacheEnabled       = true;
     _securityRepository   = securityRepository;
     AutoExpireItemsPeriod = autoExpireItemsPeriod;
     MaxItems         = maxItems;
     CacheDuration    = nodeAclCacheDuration;
     TaskWaitDuration = nodeAclTaskWaitDuration;
 }
예제 #3
0
        public void SetGlobalSettings(GlymaRepositoryProxy proxy, INamedPropertyDictionary properties)
        {
            // The global settings will be accessed by multiple threads, so synchronise access to them when configuring a proxy.
            lock (_globalSettingsLock)
            {
                if (!_globalSettingsInitialised)
                {
                    GlymaSearchLogger.WriteTrace(LogCategoryId.Connector, TraceSeverity.Medium, "Initialised global settings.");
                    GetDataAccessType(properties);
                    GetSecurityConnectionString(properties);
                    GetCrawlRules(properties);
                    GetEnableNodeAclCacheSetting(properties);
                    GetNodeAclType(properties);
                    GetEnableSecuritySetting(properties);
                    GetNodeAclCacheDuration(properties);
                    GetNodeAclCacheAutoExpirePeriod(properties);
                    GetNodeAclCacheMaxItems(properties);
                    GetNodeAclTaskWaitDuration(properties);
                    _globalSettingsInitialised = true;
                }

                IGlymaSecurityRepository securityRepository = null;
                if (_dataAccessType == DataAccessType.Sql)
                {
                    securityRepository = new SqlGlymaSecurityRepository(_securityConnectionString);
                }

                GlymaSecurityManager securityManager = null;
                if (_nodeAclType == NodeAclType.Windows)
                {
                    if (_isNodeAclCacheEnabled)
                    {
                        securityManager = new WindowsGlymaSecurityManager(securityRepository, _nodeAclCacheAutoExpirePeriod, _nodeAclCacheMaxItems, _nodeAclCacheDuration, _nodeAclTaskWaitDuration);
                    }
                    else
                    {
                        securityManager = new WindowsGlymaSecurityManager(securityRepository);
                    }
                }
                else
                {
                    throw new ApplicationException("Only the Windows node ACL type is currently supported.");
                }

                proxy.IsSecurityEnabled  = _isSecurityEnabled;
                proxy.SecurityRepository = securityRepository;
                proxy.SecurityManager    = securityManager;
                proxy.CrawlRules         = _crawlRules.DeepCopy();
            }
        }
 public WindowsGlymaSecurityManager(IGlymaSecurityRepository securityRepository)
 {
    _securityRepository = securityRepository;
 }
 public WindowsGlymaSecurityManager(IGlymaSecurityRepository securityRepository)
 {
     _securityRepository = securityRepository;
 }