public static MvcAuthorizationService ServiceBuilder(MVCRefereeConfigurationBuilder conf)
        {
            var configuration = conf.Build();

            var service = new MvcAuthorizationService(configuration.AuthorizerResolver, configuration.ActivityResolver,
                                                      new AuthorizationFailureManager(conf.ActivityRegistrations));

            return(service);
        }
Exemple #2
0
        public static IAuthorizationService Configure(MVCRefereeConfigurationBuilder builder)
        {
            var configuration = builder.Build();
            var service       = new MvcAuthorizationService(configuration.AuthorizerResolver, configuration.ActivityResolver,
                                                            new AuthorizationFailureManager(builder.ActivityRegistrations));
            var filter = new AuthorizeActivity(service, GlobalFilters.Filters);

            GlobalFilters.Filters.Add(filter);
            CurrentAuthorizationService = service;
            return(service);
        }