Exemple #1
0
        public static Repository Get(RequestContext requestContext, IDocumentStore documentStore = null)
        {
            EnsureRequestContext(requestContext);

            documentStore = documentStore ?? DocumentStoreAppInstance.Get();

            return(GetRepository(documentStore, requestContext.HttpContext.Items, requestContext.HttpContext.User));
        }
Exemple #2
0
        public static Repository Get(HttpRequestContext requestContext, IDocumentStore documentStore = null)
        {
            EnsureRequestContext(requestContext);

            documentStore = documentStore ?? DocumentStoreAppInstance.Get();

            return(GetRepository(documentStore, requestContext.Configuration.Properties, requestContext.Principal));
        }
Exemple #3
0
        public static void EnsureIsAuthorized(
            string articleIdParamName,
            ArticleAccessType accessType,
            RequestContext requestContext,
            IDictionary <string, object> actionArguments)
        {
            string slugValue = GetSlugValue(articleIdParamName, actionArguments);

            var documentStore = DocumentStoreAppInstance.Get(requestContext.HttpContext.Application);
            var repository    = RepositoryRequestInstance.Get(requestContext, documentStore);

            EnsureIsAuthorizedInternal(slugValue, repository, accessType, requestContext.HttpContext.User);
        }
Exemple #4
0
        protected void Application_Start()
        {
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            ModelBinderConfig.RegisterModelBinders(ModelBinders.Binders, GlobalConfiguration.Configuration);
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            BundleConfig.RegisterBundles();

            DocumentStore = DocumentStoreInitializer.FromAppSettingName("RavenDbConnectionString");

            var application = new HttpApplicationStateWrapper(this.Application);

            DocumentStoreAppInstance.Set(DocumentStore, application);

            SeoHelper.BaseTitle = "WikiDown";
        }