Exemplo n.º 1
0
        public GetUsersByProjectQueryHandler([NotNull] IRoleProvider roleProvider,
                                             [NotNull] IUserAuthorityValidator userAuthorityValidator,
                                             [NotNull] IUserPrincipal userPrincipal,
                                             [NotNull] IUserRoleProvider userRoleProvider)
        {
            if (roleProvider == null)
            {
                throw new ArgumentNullException(nameof(roleProvider));
            }
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }
            if (userRoleProvider == null)
            {
                throw new ArgumentNullException(nameof(userRoleProvider));
            }

            _roleProvider           = roleProvider;
            _userAuthorityValidator = userAuthorityValidator;
            _userPrincipal          = userPrincipal;
            _userRoleProvider       = userRoleProvider;
        }
        public PolicyRuleExecutor(
            [NotNull] ILog log,
            [NotNull] IQueryStorage queryStorage,
            [NotNull] IQueryExecutor queryExecutor,
            [NotNull] IUserPrincipal userPrincipal)
        {
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }
            if (queryStorage == null)
            {
                throw new ArgumentNullException(nameof(queryStorage));
            }
            if (queryExecutor == null)
            {
                throw new ArgumentNullException(nameof(queryExecutor));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _queryStorage  = queryStorage;
            _queryExecutor = queryExecutor;
            _userPrincipal = userPrincipal;
            _log           = log;
        }
Exemplo n.º 3
0
        public GetRolesByProjectQueryHandler([NotNull] IRoleProvider roleProvider,
                                             [NotNull] ISolutionGroupManager solutionGroupManager,
                                             [NotNull] IUserAuthorityValidator userAuthorityValidator,
                                             [NotNull] IUserPrincipal userPrincipal)
        {
            if (roleProvider == null)
            {
                throw new ArgumentNullException(nameof(roleProvider));
            }
            if (solutionGroupManager == null)
            {
                throw new ArgumentNullException(nameof(solutionGroupManager));
            }
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _roleProvider           = roleProvider;
            _solutionGroupManager   = solutionGroupManager;
            _userAuthorityValidator = userAuthorityValidator;
            _userPrincipal          = userPrincipal;
        }
Exemplo n.º 4
0
        public ReportStorage(
            [NotNull] IReportAuthorityValidator reportAuthorityValidator,
            [NotNull] IReportRepository reportRepository,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider,
            [NotNull] ITimeService timeService,
            [NotNull] IUserPrincipal userPrincipal)
        {
            if (reportAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(reportAuthorityValidator));
            }
            if (reportRepository == null)
            {
                throw new ArgumentNullException(nameof(reportRepository));
            }
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }
            if (timeService == null)
            {
                throw new ArgumentNullException(nameof(timeService));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _reportAuthorityValidator = reportAuthorityValidator;
            _reportRepository         = reportRepository;
            _telemetryScopeProvider   = telemetryScopeProvider;
            _timeService   = timeService;
            _userPrincipal = userPrincipal;
        }
Exemplo n.º 5
0
        private void InitHeadersData(HttpClient client, IUserPrincipal authorizedUser)
        {
            if (authorizedUser?.UserName.IsNotNullOrEmpty() == true && authorizedUser?.Password.IsNotNullOrEmpty() == true)
            {
                client.DefaultRequestHeaders.Add(
                    "Authorization",
                    $"Basic {Convert.ToBase64String(Encoding.ASCII.GetBytes($"{authorizedUser.UserName}:{authorizedUser.Password}"))}");
            }

            client.DefaultRequestHeaders.Add("Accept", "application/json");

            var request = CreateRequestMessage("me", HttpMethod.Get);

            var task = client.SendAsync(request);

            task.Wait();

            CheckResultStatusCode(task.Result);

            var setCookies = task.Result.Headers.Any(item => item.Key == "Set-Cookie")
                ? task.Result.Headers.GetValues("Set-Cookie")
                : null;

            if (setCookies != null && setCookies.Any())
            {
                var token     = setCookies.First(item => item.StartsWith("XSRF-TOKEN", StringComparison.InvariantCultureIgnoreCase)).Split(';').First().Split('=').Last();
                var sessionId = setCookies.FirstOrDefault(item => item.StartsWith("JSESSIONID", StringComparison.InvariantCultureIgnoreCase))?.Split(';').First().Split('=').Last();

                client.DefaultRequestHeaders.Add("X-XSRF-TOKEN", token);
                client.DefaultRequestHeaders.Add("Cookie", $"XSRF-TOKEN={token};JSESSIONID={sessionId};");
            }
        }
        public GetRolesByUserQueryHandler([NotNull] ISolutionGroupManager solutionGroupManager,
                                          [NotNull] IUserPrincipal userPrincipal,
                                          [NotNull] IUserProvider userProvider,
                                          [NotNull] IUserRoleProvider userRoleProvider)
        {
            if (solutionGroupManager == null)
            {
                throw new ArgumentNullException(nameof(solutionGroupManager));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }
            if (userProvider == null)
            {
                throw new ArgumentNullException(nameof(userProvider));
            }
            if (userRoleProvider == null)
            {
                throw new ArgumentNullException(nameof(userRoleProvider));
            }

            _solutionGroupManager = solutionGroupManager;
            _userPrincipal        = userPrincipal;
            _userProvider         = userProvider;
            _userRoleProvider     = userRoleProvider;
        }
Exemplo n.º 7
0
        public UpdateProjectPluginSettingsCommandHandler(
            [NotNull] IUserAuthorityValidator userAuthorityValidator,
            [NotNull] IWriteRepository <Projects> repositoryProjects,
            [NotNull] ITimeService timeService,
            [NotNull] IUnitOfWork unitOfWork,
            [NotNull] IUserPrincipal userPrincipal,
            [NotNull] IProjectPluginSettingsProvider projectPluginSettingsProvider,
            [NotNull] IPluginRepository pluginRepository)
            : base(
                userAuthorityValidator,
                repositoryProjects,
                timeService,
                unitOfWork,
                userPrincipal)
        {
            if (projectPluginSettingsProvider == null)
            {
                throw new ArgumentNullException(nameof(projectPluginSettingsProvider));
            }
            if (pluginRepository == null)
            {
                throw new ArgumentNullException(nameof(pluginRepository));
            }

            _projectPluginSettingsProvider = projectPluginSettingsProvider;
            _pluginRepository = pluginRepository;
        }
Exemplo n.º 8
0
 public CommentModel(IUserPrincipal userPrincipal)
 {
     CommentUtcTime = DateTime.UtcNow;
     ChildComments = new List<CommentModel>();
     Username = userPrincipal.UserName;
     UserRole = userPrincipal.UserRole;
     m_NodeId = Guid.NewGuid();
 }
Exemplo n.º 9
0
        public TelemetryInitializer([NotNull] IUserPrincipal userPrincipal)
        {
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _userPrincipal = userPrincipal;
        }
 public UpdateNotificationRuleCommandHandler(
     [NotNull] IUserAuthorityValidator userAuthorityValidator,
     [NotNull] IUserPrincipal userPrincipal,
     [NotNull] INotificationRuleRepository notificationRuleRepository,
     [NotNull] IUnitOfWork unitOfWork)
     : base(userAuthorityValidator, unitOfWork, userPrincipal)
 {
     _notificationRuleRepository = notificationRuleRepository;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a new session for the supplied principal
 /// </summary>
 /// <param name="principal">The user principal associated with the session instance</param>
 public Session(IUserPrincipal principal)
     : this()
 {
     if (principal == null)
     {
         throw new ArgumentNullException("principal");
     }
     _principal = principal;
 }
 public GetNotificationQueryHandler(
     INotificationRuleRepository notificationRuleRepository,
     IUserAuthorityValidator userAuthorityValidator,
     IUserPrincipal userPrincipal)
 {
     _notificationRuleRepository = notificationRuleRepository;
     _userAuthorityValidator     = userAuthorityValidator;
     _userPrincipal = userPrincipal;
 }
Exemplo n.º 13
0
        public void SetUp()
        {
            _userDataProvider = new Mock <ICurrentUserDataProvider>();

            _userDataProvider
            .Setup(_ => _.GetOrCreate())
            .Returns(_info);

            _target = new UserPrincipal(_userDataProvider.Object);
        }
Exemplo n.º 14
0
        private void InitializeTaskToExecuteInMode(ExchangePrincipal executingUser, Task task, string cmdletName, string parameterSet)
        {
            SmtpAddress    executingWindowsLiveId = SmtpAddress.Empty;
            IUserPrincipal userPrincipal          = executingUser as IUserPrincipal;

            if (userPrincipal != null)
            {
                executingWindowsLiveId = userPrincipal.WindowsLiveId;
            }
            this.InitializeTaskToExecuteInMode(executingUser.MailboxInfo.OrganizationId, executingUser.ObjectId, executingUser.ObjectId.Name, executingWindowsLiveId, task, cmdletName, parameterSet);
        }
Exemplo n.º 15
0
        public HttpClient GetClient(IUserPrincipal authorizedUser = null)
        {
            var client = new HttpClient
            {
                BaseAddress = new Uri(ConfigurationReader.GeoNetworkRestApiBaseAddress)
            };

            InitHeadersData(client, authorizedUser ?? user);

            return(client);
        }
Exemplo n.º 16
0
 protected ProjectCommandHandler(
     [NotNull] IUserAuthorityValidator userAuthorityValidator,
     [NotNull] IWriteRepository <Projects> repositoryProjects,
     [NotNull] ITimeService timeService,
     [NotNull] IUnitOfWork unitOfWork,
     [NotNull] IUserPrincipal userPrincipal)
     : base(userAuthorityValidator, unitOfWork, userPrincipal)
 {
     _repositoryProjects = repositoryProjects;
     _timeService        = timeService;
     _userPrincipal      = userPrincipal;
 }
Exemplo n.º 17
0
        public QueryStorage(
            [NotNull] IQueryAccessValidator queryAccessValidator,
            [NotNull] IQueryModelProcessor queryModelProcessor,
            [NotNull] IQueryModelValidator queryModelValidator,
            [NotNull] IQueryRepository queryRepository,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider,
            [NotNull] ITimeService timeService,
            [NotNull] IUserPrincipal userPrincipal,
            [NotNull] IUserAuthorityValidator userAuthorityValidator)
        {
            if (queryAccessValidator == null)
            {
                throw new ArgumentNullException(nameof(queryAccessValidator));
            }
            if (queryModelProcessor == null)
            {
                throw new ArgumentNullException(nameof(queryModelProcessor));
            }
            if (queryModelValidator == null)
            {
                throw new ArgumentNullException(nameof(queryModelValidator));
            }
            if (queryRepository == null)
            {
                throw new ArgumentNullException(nameof(queryRepository));
            }
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }
            if (timeService == null)
            {
                throw new ArgumentNullException(nameof(timeService));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }

            _queryAccessValidator   = queryAccessValidator;
            _queryModelProcessor    = queryModelProcessor;
            _queryRepository        = queryRepository;
            _telemetryScopeProvider = telemetryScopeProvider;
            _timeService            = timeService;
            _userAuthorityValidator = userAuthorityValidator;
            _queryModelValidator    = queryModelValidator;
            _userPrincipal          = userPrincipal;
        }
        public BackendPluginProvider([NotNull] IPluginFactory pluginFactory, [NotNull] IUserPrincipal userPrincipal)
        {
            if (pluginFactory == null)
            {
                throw new ArgumentNullException(nameof(pluginFactory));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _pluginFactory = pluginFactory;
            _userPrincipal = userPrincipal;
        }
        public GetDataSourceFieldsQueryHandler([NotNull] IDataSourceFieldInfoProvider dataSourceFieldInfoProvider,
                                               [NotNull] IUserPrincipal userPrincipal)
        {
            if (dataSourceFieldInfoProvider == null)
            {
                throw new ArgumentNullException(nameof(dataSourceFieldInfoProvider));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _dataSourceFieldInfoProvider = dataSourceFieldInfoProvider;
            _userPrincipal = userPrincipal;
        }
        public BuildReportQueryHandler(
            [NotNull] IReportBuilder reportBuilder,
            [NotNull] IUserPrincipal userPrincipal)
        {
            if (reportBuilder == null)
            {
                throw new ArgumentNullException(nameof(reportBuilder));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _reportBuilder = reportBuilder;
            _userPrincipal = userPrincipal;
        }
        public CreateTaskCommandHandler(
            [NotNull] IUserAuthorityValidator userAuthorityValidator,
            [NotNull] ITimeService timeService,
            [NotNull] IUserPrincipal userPrincipal,
            [NotNull] ITaskRepository repositoryTasks,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider,
            [NotNull] IUnitOfWork unitOfWork,
            [NotNull] IEventProvider eventProvider,
            [NotNull] ISettingsHelper settingsHelper)
            : base(userAuthorityValidator, unitOfWork, userPrincipal)
        {
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (timeService == null)
            {
                throw new ArgumentNullException(nameof(timeService));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }
            if (repositoryTasks == null)
            {
                throw new ArgumentNullException(nameof(repositoryTasks));
            }
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }
            if (eventProvider == null)
            {
                throw new ArgumentNullException(nameof(eventProvider));
            }
            if (settingsHelper == null)
            {
                throw new ArgumentNullException(nameof(settingsHelper));
            }

            _telemetryScopeProvider = telemetryScopeProvider;
            _timeService            = timeService;
            _userPrincipal          = userPrincipal;
            _repositoryTasks        = repositoryTasks;
            _eventProvider          = eventProvider;
            _settingsHelper         = settingsHelper;
        }
Exemplo n.º 22
0
 public GetSystemSettingsQueryHandler(
     IConfigManager configManager,
     IConfigurationProvider configurationProvider,
     IMailConnectionParametersProvider mailConnectionParametersProvider,
     IPluginProvider pluginProvider,
     IScanAgentRepository scanAgentRepository,
     IUserAuthorityValidator userAuthorityValidator,
     IUserPrincipal userPrincipal)
 {
     _configManager                    = configManager;
     _configurationProvider            = configurationProvider;
     _mailConnectionParametersProvider = mailConnectionParametersProvider;
     _pluginProvider                   = pluginProvider;
     _scanAgentRepository              = scanAgentRepository;
     _userAuthorityValidator           = userAuthorityValidator;
     _userPrincipal                    = userPrincipal;
 }
        public StopTaskCommandHandler(
            IUserAuthorityValidator userAuthorityValidator,
            IWriteRepository <Tasks> repositoryTasks,
            IUserPrincipal userPrincipal,
            ITimeService timeService,
            IUnitOfWork unitOfWork,
            [NotNull] IEventProvider eventProvider,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider)
            : base(userAuthorityValidator, unitOfWork, userPrincipal)
        {
            if (repositoryTasks == null)
            {
                throw new ArgumentNullException(nameof(repositoryTasks));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }
            if (timeService == null)
            {
                throw new ArgumentNullException(nameof(timeService));
            }
            if (unitOfWork == null)
            {
                throw new ArgumentNullException(nameof(unitOfWork));
            }
            if (eventProvider == null)
            {
                throw new ArgumentNullException(nameof(eventProvider));
            }
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }

            _repositoryTasks        = repositoryTasks;
            _userPrincipal          = userPrincipal;
            _timeService            = timeService;
            _eventProvider          = eventProvider;
            _telemetryScopeProvider = telemetryScopeProvider;
        }
Exemplo n.º 24
0
        public QueryModelAccessValidator([NotNull] IDataSourceInfoProvider dataSourceInfoProvider,
                                         [NotNull] IDataSourceAccessValidator dataSourceAccessValidator,
                                         [NotNull] IUserPrincipal userPrincipal)
        {
            if (dataSourceInfoProvider == null)
            {
                throw new ArgumentNullException(nameof(dataSourceInfoProvider));
            }
            if (dataSourceAccessValidator == null)
            {
                throw new ArgumentNullException(nameof(dataSourceAccessValidator));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _dataSourceInfoProvider    = dataSourceInfoProvider;
            _dataSourceAccessValidator = dataSourceAccessValidator;
            _userPrincipal             = userPrincipal;
        }
        public GetQueriesListQueryHandler([NotNull] IQueryRepository queryRepository,
                                          [NotNull] IUserAuthorityValidator userAuthorityValidator,
                                          [NotNull] IUserPrincipal userPrincipal)
        {
            if (queryRepository == null)
            {
                throw new ArgumentNullException(nameof(queryRepository));
            }
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _queryRepository        = queryRepository;
            _userAuthorityValidator = userAuthorityValidator;
            _userPrincipal          = userPrincipal;
        }
        public UpdateProjectSettingsCommandHandler(
            IUserAuthorityValidator userAuthorityValidator,
            IWriteRepository <Projects> repositoryProjects,
            ITimeService timeService,
            IUnitOfWork unitOfWork,
            IUserPrincipal userPrincipal,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider)
            : base(
                userAuthorityValidator,
                repositoryProjects,
                timeService,
                unitOfWork,
                userPrincipal)
        {
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }

            _telemetryScopeProvider = telemetryScopeProvider;
        }
Exemplo n.º 27
0
        public QueryExecutor(
            [NotNull] IDslParser dslParser,
            [NotNull] IQueryRepository queryRepository,
            [NotNull] IDslDataQueryEvaluator dslDataQueryEvaluator,
            [NotNull] IQueryBuilder queryBuilder,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider,
            [NotNull] IUserPrincipal userPrincipal)
        {
            if (dslParser == null)
            {
                throw new ArgumentNullException(nameof(dslParser));
            }
            if (queryRepository == null)
            {
                throw new ArgumentNullException(nameof(queryRepository));
            }
            if (dslDataQueryEvaluator == null)
            {
                throw new ArgumentNullException(nameof(dslDataQueryEvaluator));
            }
            if (queryBuilder == null)
            {
                throw new ArgumentNullException(nameof(queryBuilder));
            }
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _dslParser              = dslParser;
            _queryRepository        = queryRepository;
            _dslDataQueryEvaluator  = dslDataQueryEvaluator;
            _queryBuilder           = queryBuilder;
            _telemetryScopeProvider = telemetryScopeProvider;
            _userPrincipal          = userPrincipal;
        }
        public VcsCommittedEventHandler(
            [NotNull] IEventProvider eventProvider,
            [NotNull] ILog log,
            [NotNull] ITaskRepository taskRepository,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider,
            [NotNull] ITimeService timeService,
            [NotNull] IUserPrincipal userPrincipal)
        {
            if (eventProvider == null)
            {
                throw new ArgumentNullException(nameof(eventProvider));
            }
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }
            if (taskRepository == null)
            {
                throw new ArgumentNullException(nameof(taskRepository));
            }
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }
            if (timeService == null)
            {
                throw new ArgumentNullException(nameof(timeService));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _eventProvider          = eventProvider;
            _log                    = log;
            _taskRepository         = taskRepository;
            _telemetryScopeProvider = telemetryScopeProvider;
            _timeService            = timeService;
            _userPrincipal          = userPrincipal;
        }
Exemplo n.º 29
0
        public CanEditQueryQueryHandler(
            [NotNull] IQueryAccessValidator queryAccessValidator,
            [NotNull] IQueryRepository queryRepository,
            [NotNull] IUserPrincipal userPrincipal)
        {
            if (queryAccessValidator == null)
            {
                throw new ArgumentNullException(nameof(queryAccessValidator));
            }
            if (queryRepository == null)
            {
                throw new ArgumentNullException(nameof(queryRepository));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _queryAccessValidator = queryAccessValidator;
            _queryRepository      = queryRepository;
            _userPrincipal        = userPrincipal;
        }
Exemplo n.º 30
0
 public ApiService(
     [NotNull] IUserAuthorityValidator userAuthorityValidator,
     [NotNull] ICommandDispatcher commandDispatcher,
     [NotNull] ITaskRepository taskRepository,
     [NotNull] IProjectRepository projectRepository,
     [NotNull] INotificationRuleRepository notificationRuleRepository,
     [NotNull] IProjectPluginSettingsProvider projectPluginSettingsProvider,
     [NotNull] IUserPrincipal userPrincipal,
     [NotNull] IUserPluginSettingsProvider userPluginSettingsProvider,
     [NotNull] IAuthorityProvider authorityProvider,
     [NotNull] IConfigurationProvider configurationProvider,
     [NotNull] IPolicyRuleRepository policyRuleRepository,
     [NotNull] IUserInfoProvider userInfoProvider,
     [NotNull] IMailConnectionParametersProvider mailConnectionParametersProvider,
     [NotNull] ITaskResultRepository taskResultRepository,
     [NotNull] IPluginFactory pluginFactory,
     [NotNull] IUserInterfaceChecker userInterfaceChecker,
     [NotNull] IDataQueryDispatcher dataQueryDispatcher,
     [NotNull] ISettingsHelper settingsHelper)
 {
     _userAuthorityValidator        = userAuthorityValidator;
     _commandDispatcher             = commandDispatcher;
     _taskRepository                = taskRepository;
     _projectRepository             = projectRepository;
     _notificationRuleRepository    = notificationRuleRepository;
     _projectPluginSettingsProvider = projectPluginSettingsProvider;
     _userPrincipal = userPrincipal;
     _userPluginSettingsProvider       = userPluginSettingsProvider;
     _authorityProvider                = authorityProvider;
     _configurationProvider            = configurationProvider;
     _policyRuleRepository             = policyRuleRepository;
     _userInfoProvider                 = userInfoProvider;
     _mailConnectionParametersProvider = mailConnectionParametersProvider;
     _taskResultRepository             = taskResultRepository;
     _pluginFactory        = pluginFactory;
     _userInterfaceChecker = userInterfaceChecker;
     _dataQueryDispatcher  = dataQueryDispatcher;
     _settingsHelper       = settingsHelper;
 }
Exemplo n.º 31
0
        protected CommandHandler(
            [NotNull] IUserAuthorityValidator userAuthorityValidator,
            [NotNull] IUnitOfWork unitOfWork,
            [NotNull] IUserPrincipal userPrincipal)
        {
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (unitOfWork == null)
            {
                throw new ArgumentNullException(nameof(unitOfWork));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }

            _userAuthorityValidator = userAuthorityValidator;
            _unitOfWork             = unitOfWork;
            _userPrincipal          = userPrincipal;
        }