public object Create(object parent, object configContext, XmlNode section)
        {
            var configuration = new BrightstarServiceConfiguration();

            var connectionStringAttr = section.Attributes["connectionString"];

            if (connectionStringAttr != null)
            {
                configuration.ConnectionString = connectionStringAttr.Value;
            }

            if (section is XmlElement)
            {
                var sectionEl        = section as XmlElement;
                var storePermissions = sectionEl.GetElementsByTagName("storePermissions").Item(0) as XmlElement;
                if (storePermissions != null)
                {
                    configuration.StorePermissionsProvider = ProcessStorePermissions(storePermissions);
                }

                var systemPermissions = sectionEl.GetElementsByTagName("systemPermissions").Item(0) as XmlElement;
                if (systemPermissions != null)
                {
                    configuration.SystemPermissionsProvider = ProcessSystemPermissions(systemPermissions);
                }
            }
            return(configuration);
        }
        public object Create(object parent, object configContext, XmlNode section)
        {
            var configuration = new BrightstarServiceConfiguration();

            var connectionStringAttr = section.Attributes["connectionString"];
            if (connectionStringAttr != null) configuration.ConnectionString = connectionStringAttr.Value;

            if (section is XmlElement)
            {
                var sectionEl = section as XmlElement;
                
                var authenticationProviders =
                    sectionEl.GetElementsByTagName("authenticationProviders").Item(0) as XmlElement;
                if (authenticationProviders != null)
                {
                    configuration.AuthenticationProviders = ProcessAuthenticationProviders(authenticationProviders);
                }

                var storePermissions = sectionEl.GetElementsByTagName("storePermissions").Item(0) as XmlElement;
                if (storePermissions != null)
                {
                    configuration.StorePermissionsProvider = ProcessStorePermissions(storePermissions);
                }
                
                var systemPermissions = sectionEl.GetElementsByTagName("systemPermissions").Item(0) as XmlElement;
                if (systemPermissions != null)
                {
                    configuration.SystemPermissionsProvider = ProcessSystemPermissions(systemPermissions);
                }
            }
            return configuration;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new bootstrapper from the specified configuration and root path configuration
 /// </summary>
 /// <param name="configuration">The service configuration</param>
 /// <param name="rootPath">The root path</param>
 public BrightstarBootstrapper(BrightstarServiceConfiguration configuration, string rootPath = null)
     : this(BrightstarService.GetClient(configuration.ConnectionString),
            configuration.AuthenticationProviders,
            configuration.StorePermissionsProvider,
            configuration.SystemPermissionsProvider,
            rootPath)
 {
 }
 /// <summary>
 /// Create a new bootstrapper from the specified configuration and root path configuration
 /// </summary>
 /// <param name="configuration">The service configuration</param>
 /// <param name="rootPath">The root path</param>
 public BrightstarBootstrapper(BrightstarServiceConfiguration configuration, string rootPath = null)
     : this(BrightstarService.GetClient(configuration.ConnectionString),
            configuration.AuthenticationProviders,
            configuration.StorePermissionsProvider,
            configuration.SystemPermissionsProvider,
            rootPath)
 {
 }
 /// <summary>
 /// Create a new bootstrapper from the specified configuration and root path configuration
 /// with an override for the IBrightstarService instance to be used
 /// </summary>
 /// <param name="service">The IBrightstarService instance to be used</param>
 /// <param name="configuration">The service configuration</param>
 /// <param name="rootPath">The root path</param>
 public BrightstarBootstrapper(IBrightstarService service,
                               BrightstarServiceConfiguration configuration,
                               string rootPath = null)
     : this(service,
            configuration.AuthenticationProviders,
            configuration.StorePermissionsProvider,
            configuration.SystemPermissionsProvider,
            rootPath)
 {
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Create a new bootstrapper from the specified configuration and root path configuration
        /// with an override for the IBrightstarService instance to be used
        /// </summary>
        /// <param name="service">The IBrightstarService instance to be used</param>
        /// <param name="configuration">The service configuration</param>
        /// <param name="rootPath">The root path</param>
        public BrightstarBootstrapper(IBrightstarService service,
                                      BrightstarServiceConfiguration configuration,
                                      string rootPath = null)
            : this(service,
                   configuration.AuthenticationProviders,
                   configuration.StorePermissionsProvider,
                   configuration.SystemPermissionsProvider,
                   rootPath)
        {

        }