public SiteLibraryBrowser(IFolderManager <FileDocument> folderManager, IContextAccessor <AdminContext> adminContextAccessor) { _folderManager = folderManager; _adminContext = adminContextAccessor.GetContext(); ownerId = _adminContext?.SiteId; }
/// <summary> /// Initializes a new instance of the <see cref="UrlHelper"/> class using the specified action context and action selector. /// </summary> /// <param name="contextAccessor">The <see cref="IContextAccessor{TContext}"/> to access the action context /// of the current request.</param> /// <param name="actionSelector">The <see cref="IActionSelector"/> to be used for verifying the correctness of /// supplied parameters for a route. /// </param> public UrlHelper(IContextAccessor <ActionContext> contextAccessor, IActionSelector actionSelector) { _httpContext = contextAccessor.Value.HttpContext; _router = contextAccessor.Value.RouteData.Routers[0]; _ambientValues = contextAccessor.Value.RouteData.Values; _actionSelector = actionSelector; }
private ContextAccessor(IConfiguration config) { log = Log.Logger.ForContext <ContextAccessor>(); string persistanceType = config.GetSection("PersistanceType").Value; log.Here().Information("PersistanceType is " + persistanceType); if (persistanceType == "File") { FilePathConfig filePaths = config.GetSection("FileDataPath").Get <FilePathConfig>(); string contextPath = filePaths.ContextFilePath; this.accessor = new ContextFileAccessor(contextPath); this.accessor.CleanContext(); } else { string connectionString = config.GetConnectionString("MongoDbConnection"); string dbName = config.GetConnectionString("ContextDatabaseName"); this.accessor = new ContextDBAccessor(connectionString, dbName); this.accessor.CleanContext(); } }
public LibraryDataController( IFolderManager <FileDocument> folderManager, IDocumentService <FileDocument> documentService, IOptions <DriveOptions> driveOptions, TagManager tagManager, DbLoggerProvider log, DbLogService logFetcher, ILogger <LibraryDataController> logger, ResourceManager resourceManager, FileFolderBrowser fileFolderBrowser, IAuthorizationService authorizationService, IContextAccessor <AdminContext> adminContextAccessor, IContextAccessor <SiteContext> siteContextAccessor) : base(logger) { _folderManager = folderManager; _documentService = documentService; _driveOptions = driveOptions.Value; _tagManager = tagManager; _log = log; _logFetcher = logFetcher; _resourceManager = resourceManager; _fileFolderBrowser = fileFolderBrowser; _authorizationService = authorizationService; _adminContext = adminContextAccessor.GetContext(); _siteContext = siteContextAccessor.GetContext(); }
public UrlHelper(IContextAccessor<ActionContext> contextAccessor, IActionSelector actionSelector) { _httpContext = contextAccessor.Value.HttpContext; _router = contextAccessor.Value.RouteData.Routers[0]; _ambientValues = contextAccessor.Value.RouteData.Values; _actionSelector = actionSelector; }
public LibraryOwnerHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { ClientClaimTypes.AppLibraryOwner, ClientClaimTypes.PrimaryAdmin }; }
public BlogQueryService(SiteContext siteContext, BlogSecurityService blogSecurity, ConnectDbContext connectDbContext, BlogDbContext blogDbContext, IContextAccessor <UserContext> userContextAccessor) { _siteContext = siteContext; _connectDbContext = connectDbContext; _blogDbContext = blogDbContext; _blogSecurity = blogSecurity; _userContextAccessor = userContextAccessor; }
public ProductsReadHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { CorpClaimTypes.CorpProductsRead, CorpClaimTypes.CorpPrimaryAdmin }; }
public RolesEditHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { ClientClaimTypes.AppRolesEdit, ClientClaimTypes.PrimaryAdmin }; }
internal static Step InstanceFor(IContextAccessor test, Type stepClass, KeyValuePair <string, object>[] parameters, IExceptionHandler exceptionHandler) { var instance = (Step)Activator.CreateInstance(stepClass, parameters.Select(p => p.Value).ToArray()); instance.SetScenario(test, exceptionHandler); return(instance); }
public LibraryEditFilesHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { CorpClaimTypes.CorpLibraryEditFiles, CorpClaimTypes.CorpPrimaryAdmin }; }
public TestResponseGenerator(IContextAccessor<ActionContext> contextAccessor) { _actionContext = contextAccessor.Value; if (_actionContext == null) { throw new InvalidOperationException("ActionContext should not be null here."); } }
public LibraryManageSecurityHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { CorpClaimTypes.CorpLibraryManageSecurity, CorpClaimTypes.CorpPrimaryAdmin }; }
public ClientsEditHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { CorpClaimTypes.CorpCustomersEdit, CorpClaimTypes.CorpPrimaryAdmin }; }
public AnnouncementQueryService(SiteContext siteContext, AnnouncementSecurityService announcementSecurity, ConnectDbContext connectDbContext, AnnouncementDbContext announcementDbContext, IContextAccessor <UserContext> userContextAccessor) { _siteContext = siteContext; _connectDbContext = connectDbContext; _announcementDbContext = announcementDbContext; _announcementSecurity = announcementSecurity; _userContextAccessor = userContextAccessor; }
public TestResponseGenerator(IContextAccessor <ActionContext> contextAccessor) { _actionContext = contextAccessor.Value; if (_actionContext == null) { throw new InvalidOperationException("ActionContext should not be null here."); } }
public NotificationGroupsDeleteHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { ClientClaimTypes.AppNotifyGroupsDelete, ClientClaimTypes.PrimaryAdmin }; }
public UserProfileEditHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { ClientClaimTypes.UsersEdit, ClientClaimTypes.PrimaryAdmin }; }
public DirectoriesReadHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { ClientClaimTypes.UserDirectoryRead, ClientClaimTypes.PrimaryAdmin }; }
public SitesReadHandler(IContextAccessor<AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { ClientClaimTypes.SitesRead, ClientClaimTypes.PrimaryAdmin }; }
public GroupsCreateHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { ClientClaimTypes.AppGroupsCreate, ClientClaimTypes.PrimaryAdmin }; }
public NettyServerBootstrap(IServerMessageHandler <TMessage> handler, IMessageCodecs <TMessage> msgCodecs, ILoggerFactory factory, IContextAccessor <TMessage> contextAccessor) { this._msgCodecs = msgCodecs; this._handler = handler; this._contextAccessor = contextAccessor; this.Logger = factory.CreateLogger(this.GetType()); this._factory = factory; }
public AnnouncementSecurityService ( IContextAccessor <SiteContext> siteContextAccessor, IContextAccessor <UserContext> userContextAccessor ) { _siteContextAccessor = siteContextAccessor; _userContextAccessor = userContextAccessor; }
public EnquiriesBusinessService(IEnquiriesDataService enquiriesDataService, IContextAccessor contextAccessor, IServiceBusMessageSender serviceBusMessageSender, IMapper mapper) { _enquiriesDataService = enquiriesDataService; _contextAccessor = contextAccessor; _serviceBusMessageSender = serviceBusMessageSender; _mapper = mapper; _browserName = _contextAccessor.BrowserName; _timestamp = _contextAccessor.TimeStamp; }
public UserProfileReadHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { SiteClaimTypes.SiteUsersRead, SiteClaimTypes.SitePrimaryAdmin, ClientClaimTypes.PrimaryAdmin }; }
public GroupsDeleteHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { SiteClaimTypes.SitePrimaryAdmin, SiteClaimTypes.SiteGroupsDelete, ClientClaimTypes.PrimaryAdmin }; }
public UserContentMenu(IContextAccessor <SiteContext> siteContextAccessor, Routes routes, IHttpContextAccessor httpContextAccessor) { var siteContext = siteContextAccessor.GetContext(); if (siteContext != null) { _siteId = siteContext.SiteId; _tenant = siteContext.TenantKey; _clientId = siteContext.Client.Id; _corpId = ConnectCoreConstants.CorporateId; var isSiteAlertsFeatureEnabled = siteContext.ProductContext.Features.Get(FeatureId.Alerts)?.GetSettingValue <bool>("enabled") ?? false; var isNotificationFeatureEnabled = siteContext.ProductContext.Features.Get(FeatureId.Notifications)?.GetSettingValue <bool>("enabled") ?? false; var httpContext = httpContextAccessor.HttpContext; var returnUrl = httpContext.Request.GetRelativeUrlEncoded(); MenuItems = new List <IMenuItem>() { // NOTE: This menu provider is part of core, thus only "known" core types of content should be listed here // So far, we have none. "Create Blog Link" moved to Blog.UserContentMenu new MenuItemSecureCustom() { Title = "Add Notifications", Url = routes.Account("notifications") + "?ru=" + returnUrl, Icon = IconType.Message, AuthorizeCallback = user => { return(user.SecurityClaims.Any(x => (((x.Type == SiteClaimTypes.SiteNotificationsSend) && ((x.Value == _siteId) || (x.Value == _clientId) || (x.Value == _corpId)) || (x.Type == SiteClaimTypes.SitePrimaryAdmin) && ((x.Value == _siteId) || (x.Value == _clientId) || (x.Value == _corpId))) || (x.Type.StartsWith("corp-") && x.Value == ConnectCoreConstants.CorporateId)) && isNotificationFeatureEnabled)); } }, new MenuItemSecureCustom() { Title = "Create Alert", Url = "javascript: void $.console('alerts', '/sys/console/sitealerts/create')", Icon = IconType.Alert, AuthorizeCallback = user => { return(user.SecurityClaims.Any(x => ((x.Type == ClientClaimTypes.PrimaryAdmin) || (x.Type == SiteClaimTypes.SitePrimaryAdmin) || (x.Type.StartsWith("corp-") && x.Value == ConnectCoreConstants.CorporateId)) && isSiteAlertsFeatureEnabled)); } } }; } }
public RequireFeatureActionFilter(IContextAccessor <ClientAdminContext> clientAccessor, string id) { Ensure.NotNull(clientAccessor, "Null ClientAdminContextAccessor passed into constructor of " + GetType().Name); _product = clientAccessor.GetContext()?.Product; Ensure.NotNull(_product, "Null ProductContext derived from ClientAdminContext passed into constructor of " + GetType().Name); _featureId = id; }
public SiteSettingsEditHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { SiteClaimTypes.SiteSettingsEdit, SiteClaimTypes.SitePrimaryAdmin, ClientClaimTypes.PrimaryAdmin }; }
public NotificationGroupsCreateHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { SiteClaimTypes.SiteNotifyGroupsCreate, SiteClaimTypes.SitePrimaryAdmin, ClientClaimTypes.PrimaryAdmin }; }
public NavMenusCreateHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { SiteClaimTypes.SiteNavMenusCreate, SiteClaimTypes.SitePrimaryAdmin, ClientClaimTypes.PrimaryAdmin }; }
public PagesDesignHandler(IContextAccessor <AdminContext> adminContextAccessor) : base(adminContextAccessor) { ValidClaimTypes = new string[] { SiteClaimTypes.SitePagesDesign, SiteClaimTypes.SitePrimaryAdmin, ClientClaimTypes.PrimaryAdmin }; }
public ContactFormSubmissionWriter(IContextAccessor accessor) { _accessor = accessor; }
public TestimonialReader(IContextAccessor accessor) { _accessor = accessor; }
public ClientReader(IContextAccessor accessor) { _accessor = accessor; }
public HttpAuthenticationManager(IContextAccessor<HttpContext> contextAccessor) { Context = contextAccessor.Value; }
public ContractReader(IContextAccessor accessor) { _accessor = accessor; }
public ProjectReader(IContextAccessor accessor) { _accessor = accessor; }
public HistoryReader(IContextAccessor accessor) { _accessor = accessor; }
public SkillReader(IContextAccessor accessor) { _accessor = accessor; }
public CurriculumVitaeReader(IContextAccessor accessor) { _accessor = accessor; }
private static UrlHelper CreateUrlHelper(IContextAccessor<ActionContext> contextAccessor) { var actionSelector = new Mock<IActionSelector>(MockBehavior.Strict); return new UrlHelper(contextAccessor, actionSelector.Object); }