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

            documentStore = documentStore ?? DocumentStoreAppInstance.Get();

            return(GetRepository(documentStore, requestContext.Configuration.Properties, requestContext.Principal));
        }
Beispiel #2
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));
        }
Beispiel #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);
        }