Exemple #1
0
        /// <summary>
        /// Configure route provider
        /// </summary>
        /// <param name="routeName"></param>
        /// <param name="setupProvider"></param>
        /// <returns>This instance</returns>
        public IRouteAuthorizationBuilder ConfigureRouteProvider(string routeName, Action <IProviderCollection> setupProvider)
        {
            var manager = new ProviderCollection();

            setupProvider(manager);

            if (_useOrLogicForAuthorizationProviders)
            {
                _provider.Add(new RouteAnyAggregateAuthorizationProvider(routeName, manager));
            }
            else
            {
                _provider.Add(new RouteAggregateAuthorizationProvider(routeName, manager));
            }

            return(this);
        }
Exemple #2
0
        /// <summary>
        /// Configure wildcard provider
        /// </summary>
        /// <param name="setupProviders"></param>
        /// <returns>This instance</returns>
        public IRouteAuthorizationBuilder ConfigureWildCardProviders(Action <IProviderCollection> setupProviders)
        {
            var manager = new ProviderCollection();

            setupProviders(manager);

            if (_useOrLogicForAuthorizationProviders)
            {
                _provider.Add(new WildCardAnyOfAggregateAuthorizationProvider(manager));
            }
            else
            {
                _provider.Add(new WildCardAggregateAuthorizationProvider(manager));
            }

            return(this);
        }