Example #1
0
        public EmployeeService(
            IUserInfoProvider userContextPrtovider,
            IEmployeeRepository employeeRepository,
            IContactService contactService,
            IPassportService passportService,
            IOrganizationService organizationService,
            IStateRegistrationService stateRegistrationService,
            DomainContext domainContext)
        {
            Contract.Argument.IsNotNull(userContextPrtovider, nameof(userContextPrtovider));
            Contract.Argument.IsNotNull(employeeRepository, nameof(employeeRepository));
            Contract.Argument.IsNotNull(contactService, nameof(contactService));
            Contract.Argument.IsNotNull(passportService, nameof(passportService));
            Contract.Argument.IsNotNull(organizationService, nameof(organizationService));
            Contract.Argument.IsNotNull(stateRegistrationService, nameof(stateRegistrationService));
            Contract.Argument.IsNotNull(domainContext, nameof(domainContext));

            _userContextPrtovider     = userContextPrtovider;
            _employeeRepository       = employeeRepository;
            _contactService           = contactService;
            _passportService          = passportService;
            _organizationService      = organizationService;
            _stateRegistrationService = stateRegistrationService;
            _domainContext            = domainContext;
        }
        public UsersService(ApplicationDbContext dbContext,
                            IEncrypter encrypter,
                            IUserInfoProvider userInfoProvider,
                            IPolicy <RegisterUserModel> registerUserPolicy,
                            IPolicy <RegisterDomainUserModel> registerDomainUserPolicy,
                            IPolicy <UpdateUserModel> updateUserPolicy,
                            IPolicy <PasswordResetRequestModel> requestPasswordResetPolicy,
                            IPolicy <ResetPasswordModel> resetPasswordPolicy,
                            IPolicy <PasswordModel> passwordPolicy,
                            ICommsService commsService,
                            IConfigurationRoot configurationRoot)
        {
            this.dbContext                  = dbContext;
            this.encrypter                  = encrypter;
            this.userInfoProvider           = userInfoProvider;
            this.registerUserPolicy         = registerUserPolicy;
            this.registerDomainUserPolicy   = registerDomainUserPolicy;
            this.updateUserPolicy           = updateUserPolicy;
            this.requestPasswordResetPolicy = requestPasswordResetPolicy;
            this.passwordPolicy             = passwordPolicy;
            this.resetPasswordPolicy        = resetPasswordPolicy;
            this.commsService               = commsService;
            this.configurationRoot          = configurationRoot;
            this.websiteConfiguration       = new WebsiteConfiguration();

            configurationRoot.GetSection("WebsiteConfiguration").Bind(websiteConfiguration);
        }
 public ChangeDepartmentCommand(IUserInfoProvider userInfoProvider, IRepository <User> userRepository, IRepository <Department> departmentRepository, CreateNotificationCommand createNotificationCommand)
 {
     this.userRepository            = userRepository;
     this.departmentRepository      = departmentRepository;
     this.createNotificationCommand = createNotificationCommand;
     this.userInfoProvider          = userInfoProvider;
 }
Example #4
0
        public BaseEntityRepository(IDatabaseFactory databaseFactory, IUserInfoProvider userInfoProvider)
            : base(databaseFactory)
        {
            _userInfoProvider = userInfoProvider;

            ((DataContext)Context).SavingChanges += OnSavingChanges;
        }
        /// <summary>
        /// Initializes the Mixed Reality Extension SDK API.
        /// </summary>
        /// <param name="defaultMaterial">The material template used for all SDK-spawned meshes.</param>
        /// <param name="behaviorFactory">The behavior factory to use within the runtime.</param>
        /// <param name="textFactory">The text factory to use within the runtime.</param>
        /// <param name="primitiveFactory">The primitive factory to use within the runtime.</param>
        /// <param name="libraryFactory">The library resource factory to use within the runtime.</param>
        /// <param name="assetCache">The place for this MRE to cache its meshes, etc.</param>
        /// <param name="gltfImporterFactory">The glTF loader factory. Uses default GLTFSceneImporter if omitted.</param>
        /// <param name="materialPatcher">Overrides default material property map (color and mainTexture only).</param>
        /// <param name="userInfoProvider">Provides appId/sessionId scoped IUserInfo instances.</param>
        /// <param name="engineConstants">Engine constants supplied by the host app.</param>
        /// <param name="logger">The logger to be used by the MRE SDK.</param>
        public static void InitializeAPI(
            UnityEngine.Material defaultMaterial,
            IBehaviorFactory behaviorFactory       = null,
            ITextFactory textFactory               = null,
            IPrimitiveFactory primitiveFactory     = null,
            ILibraryResourceFactory libraryFactory = null,
            IAssetCache assetCache = null,
            IGLTFImporterFactory gltfImporterFactory = null,
            IMaterialPatcher materialPatcher         = null,
            IUserInfoProvider userInfoProvider       = null,
            IEngineConstants engineConstants         = null,
            IMRELogger logger = null)
        {
            AppsAPI.DefaultMaterial        = defaultMaterial;
            AppsAPI.BehaviorFactory        = behaviorFactory;
            AppsAPI.TextFactory            = textFactory ?? throw new ArgumentException($"{nameof(textFactory)} cannot be null");
            AppsAPI.PrimitiveFactory       = primitiveFactory ?? new MWPrimitiveFactory();
            AppsAPI.LibraryResourceFactory = libraryFactory;
            AppsAPI.AssetCache             = assetCache ?? new AssetCache();
            AppsAPI.GLTFImporterFactory    = gltfImporterFactory ?? new GLTFImporterFactory();
            AppsAPI.MaterialPatcher        = materialPatcher ?? new DefaultMaterialPatcher();
            AppsAPI.UserInfoProvider       = userInfoProvider ?? new NullUserInfoProvider();
            AppsAPI.EngineConstants        = engineConstants;

#if ANDROID_DEBUG
            Logger = logger ?? new UnityLogger();
#else
            Logger = logger ?? new ConsoleLogger();
#endif
        }
        /// <summary>
        /// Initializes the Mixed Reality Extension SDK API.
        /// </summary>
        /// <param name="defaultMaterial">The material template used for all SDK-spawned meshes.</param>
        /// <param name="layerApplicator">The class used to apply MRE layers to Unity colliders.</param>
        /// <param name="behaviorFactory">The behavior factory to use within the runtime.</param>
        /// <param name="textFactory">The text factory to use within the runtime.</param>
        /// <param name="primitiveFactory">The primitive factory to use within the runtime.</param>
        /// <param name="libraryFactory">The library resource factory to use within the runtime.</param>
        /// <param name="gltfImporterFactory">The glTF loader factory. Uses default GLTFSceneImporter if omitted.</param>
        /// <param name="materialPatcher">Overrides default material property map (color and mainTexture only).</param>
        /// <param name="videoPlayerFactory"></param>
        /// <param name="userInfoProvider">Provides appId/sessionId scoped IUserInfo instances.</param>
        /// <param name="dialogFactory"></param>
        /// <param name="logger">The logger to be used by the MRE SDK.</param>
        public static void InitializeAPI(
            UnityEngine.Material defaultMaterial,
            ILayerApplicator layerApplicator,
            IBehaviorFactory behaviorFactory         = null,
            ITextFactory textFactory                 = null,
            IPrimitiveFactory primitiveFactory       = null,
            ILibraryResourceFactory libraryFactory   = null,
            IGLTFImporterFactory gltfImporterFactory = null,
            IMaterialPatcher materialPatcher         = null,
            IVideoPlayerFactory videoPlayerFactory   = null,
            IUserInfoProvider userInfoProvider       = null,
            IDialogFactory dialogFactory             = null,
            IMRELogger logger = null)
        {
            AppsAPI.DefaultMaterial        = defaultMaterial;
            AppsAPI.LayerApplicator        = layerApplicator;
            AppsAPI.BehaviorFactory        = behaviorFactory;
            AppsAPI.TextFactory            = textFactory ?? throw new ArgumentException($"{nameof(textFactory)} cannot be null");
            AppsAPI.PrimitiveFactory       = primitiveFactory ?? new MWPrimitiveFactory();
            AppsAPI.LibraryResourceFactory = libraryFactory;
            AppsAPI.VideoPlayerFactory     = videoPlayerFactory;
            AppsAPI.GLTFImporterFactory    = gltfImporterFactory ?? new GLTFImporterFactory();
            AppsAPI.MaterialPatcher        = materialPatcher ?? new DefaultMaterialPatcher();
            AppsAPI.UserInfoProvider       = userInfoProvider ?? new NullUserInfoProvider();
            AppsAPI.DialogFactory          = dialogFactory;

#if ANDROID_DEBUG
            Logger = logger ?? new UnityLogger(null);
#else
            Logger = logger ?? new ConsoleLogger(null);
#endif
        }
Example #7
0
        public InvitationService(
            IClock clock,
            IUserInfoProvider userContextPrtovider,
            IInvitationRepository invitationRepository,
            IAlienService alienService,
            IEmployeeService employeeService,
            IVisitDetailService visitDetailService,
            IForeignParticipantService foreignParticipantService)
        {
            Contract.Argument.IsNotNull(clock, nameof(clock));
            Contract.Argument.IsNotNull(userContextPrtovider, nameof(userContextPrtovider));
            Contract.Argument.IsNotNull(invitationRepository, nameof(invitationRepository));
            Contract.Argument.IsNotNull(alienService, nameof(alienService));
            Contract.Argument.IsNotNull(employeeService, nameof(employeeService));
            Contract.Argument.IsNotNull(visitDetailService, nameof(visitDetailService));
            Contract.Argument.IsNotNull(foreignParticipantService, nameof(foreignParticipantService));

            _clock = clock;
            _userContextPrtovider      = userContextPrtovider;
            _invitationRepository      = invitationRepository;
            _alienService              = alienService;
            _employeeService           = employeeService;
            _visitDetailService        = visitDetailService;
            _foreignParticipantService = foreignParticipantService;
        }
 public AccessRightChecker(
     IUserInfoProvider userInfoProvider,
     IRepository <User> userRepository
     )
 {
     this.userInfoProvider = userInfoProvider;
     this.userRepository   = userRepository;
 }
Example #9
0
 public CreateNotificationCommand(IRepository <Department> departamentRepository, IRepository <Notification> notificationRepository, IRepository <User> userRepository, IUserInfoProvider userInfoProvider, IRepository <DepartmentNotification> departmentNotificationRepository)
 {
     this.notificationRepository           = notificationRepository;
     this.userRepository                   = userRepository;
     this.departmentNotificationRepository = departmentNotificationRepository;
     this.departamentRepository            = departamentRepository;
     this.userInfoProvider                 = userInfoProvider;
 }
 public LearningManagementService(ICourseRepository courseRepository,
                                  IEnrollmentRepository enrollmentRepository,
                                  IUserInfoProvider userInfoProvider)
 {
     _courseRepository     = courseRepository;
     _enrollmentRepository = enrollmentRepository;
     _userInfoProvider     = userInfoProvider;
 }
Example #11
0
 public SignInManager(IHttpContextAccessor contextAccessor,
                      IAuthenticationSchemeProvider authenticationSchemeProvider,
                      IUserInfoProvider userInfoProvider)
 {
     _contextAccessor = contextAccessor;
     _authenticationSchemeProvider = authenticationSchemeProvider;
     _userInfoProvider             = userInfoProvider;
 }
Example #12
0
 public DashboardsService(
     ApplicationDbContext dbContext,
     IUserInfoProvider userInfoProvider
     )
 {
     this.dbContext        = dbContext;
     this.userInfoProvider = userInfoProvider;
 }
Example #13
0
 public GetProfileHandler(UserManager <User> userManager,
                          IMapper mapper,
                          IUserInfoProvider userInfoProvider)
 {
     _userManager      = userManager;
     _mapper           = mapper;
     _userInfoProvider = userInfoProvider;
 }
Example #14
0
 public ChatApiController(
     IUserRepository userRepository,
     IChatService chatService,
     IUserInfoProvider userInfoProvider)
     : base(userRepository, userInfoProvider)
 {
     _chatService = chatService;
 }
Example #15
0
 public HomeController(IUserRepository userRepository, IUserInfoProvider userInfoProvider
                       , ICourseApplicationRepository courseApplicationRepository, ICourseRepository courseRepository
                       )
     : base(userRepository, userInfoProvider)
 {
     _userRepository = userRepository;
     _courseApplicationRepository = courseApplicationRepository;
     _courseRepository            = courseRepository;
 }
 public ApplicationInfoesController(IHttpClientFactory httpClientFactory,
                                    ATASecurityClient securityClient,
                                    IUserInfoProvider userInfoProvider)
 {
     _httpClientFactory = httpClientFactory;
     _securityClient    = securityClient.Client;
     _securityClient.DefaultRequestHeaders.Add("SSOToken",
                                               userInfoProvider.CurrentUser()?.SsoToken);
 }
Example #17
0
 public UpdateProfileHandler(
     UserManager <User> userManager,
     IUnitOfWork unitOfWork,
     IUserInfoProvider userInfoProvider)
 {
     _userManager      = userManager;
     _unitOfWork       = unitOfWork;
     _userInfoProvider = userInfoProvider;
 }
 public AuthenticateUserCommand(
     IRepository <User> userRepository,
     IUserInfoProvider userInfoProvider,
     IAccessRightChecker accessRightChecker
     )
 {
     this.userRepository     = userRepository;
     this.userInfoProvider   = userInfoProvider;
     this.accessRightChecker = accessRightChecker;
 }
 public GetTodoListByIdQuery(
     IAccessRightChecker accessRightChecker,
     IRepository <TodoList> todoListRepository,
     IUserInfoProvider userInfoProvider
     )
 {
     this.accessRightChecker = accessRightChecker;
     this.todoListRepository = todoListRepository;
     this.userInfoProvider   = userInfoProvider;
 }
Example #20
0
 public CourseController(
     ICourseRepository courseRepository,
     ITutorRepository tutorRepository,
     IUserRepository userRepository,
     IUserInfoProvider userInfoProvider)
     : base(userRepository, userInfoProvider)
 {
     _courseRepository = courseRepository;
     _tutorRepository  = tutorRepository;
 }
Example #21
0
 public KenticoUserService(
     IMapper Mapper,
     IUserInfoProvider UserInfoProvider,
     ApplicationUserManager <ApplicationUser> userManager,
     IMessageService emailService)
 {
     _UserManager      = userManager;
     _Mapper           = Mapper;
     _UserInfoProvider = UserInfoProvider;
     _EmailService     = emailService;
 }
Example #22
0
 public ChatService(
     IChatMessageStorage chatMessageStorage,
     INotificationService notificationService,
     ITimeService timeService,
     IUserInfoProvider userInfoProvider)
 {
     _chatMessageStorage  = chatMessageStorage ?? throw new ArgumentNullException(nameof(chatMessageStorage));
     _notificationService = notificationService ?? throw new ArgumentNullException(nameof(notificationService));
     _timeService         = timeService ?? throw new ArgumentNullException(nameof(timeService));
     _userInfoProvider    = userInfoProvider ?? throw new ArgumentNullException(nameof(userInfoProvider));
 }
Example #23
0
 public CreateDefaultAdminCommand(
     IRepository <User> userRepository,
     IUserInfoProvider userInfoProvider,
     IDbChangesUpdater changesUpdater,
     IAccessRightChecker accessRightChecker
     )
 {
     this.userRepository     = userRepository;
     this.accessRightChecker = accessRightChecker;
     this.userInfoProvider   = userInfoProvider;
     this.changesUpdater     = changesUpdater;
 }
 public RemoveUserCommand(
     IRepository <User> userRepository,
     IAccessRightChecker accessRightChecker,
     IDbChangesUpdater changesSaver,
     IUserInfoProvider userInfoProvider
     )
 {
     this.userRepository     = userRepository;
     this.accessRightChecker = accessRightChecker;
     this.changesSaver       = changesSaver;
     this.userInfoProvider   = userInfoProvider;
 }
Example #25
0
        public async Task Invoke(HttpContext httpContext, IUserInfoProvider userInfoProvider)
        {
            var idClaim           = httpContext.User.Claims.FirstOrDefault(c => c.Type == "UserId")?.Value;
            var departmentIdClaim = httpContext.User.Claims.FirstOrDefault(c => c.Type == "DepartmentId")?.Value;

            if (!string.IsNullOrEmpty(idClaim) && Guid.TryParse(idClaim, out var userId) &&
                !string.IsNullOrEmpty(departmentIdClaim) && Guid.TryParse(departmentIdClaim, out var departmentId))
            {
                userInfoProvider.SetUserInfo(userId, departmentId);
            }

            await _next(httpContext);
        }
Example #26
0
        /// <summary>
        /// Constructor.
        /// You can use a dependency injection container to initialize required services and providers.
        /// </summary>
        public RegisterWithConsentController(IEventLogService eventLogService,
                                             IFormConsentAgreementService formConsentAgreementService,
                                             IUserInfoProvider userInfoProvider,
                                             IConsentInfoProvider consentInfoProvider)
        {
            this.eventLogService             = eventLogService;
            this.formConsentAgreementService = formConsentAgreementService;
            this.userInfoProvider            = userInfoProvider;

            // Gets the related consent
            // Fill in the code name of the appropriate consent object in Kentico
            consent = consentInfoProvider.Get("SampleRegistrationConsent");
        }
Example #27
0
 public UpdateTodoListItemCommand(
     IRepository <TodoListItem> todoListItemRepository,
     IRepository <User> userRepository,
     IAccessRightChecker accessRightChecker,
     IDbChangesUpdater changesSaver,
     IUserInfoProvider userInfoProvider
     )
 {
     this.todoListItemRepository = todoListItemRepository;
     this.userRepository         = userRepository;
     this.accessRightChecker     = accessRightChecker;
     this.changesSaver           = changesSaver;
     this.userInfoProvider       = userInfoProvider;
 }
Example #28
0
 public RequestTrialCommandHandler(
     ILicenseClient licenseClient,
     IDeviceIdProvider deviceIdProvider,
     IUserInfoProvider userInfoProvider,
     ILicenseStorage licenseStorage,
     ILicensePublicKeyStorage publicKeyStorage,
     ILicenseValidator licenseValidator,
     ILicenseInformationProvider licenseInformationProvider,
     ILogger <RequestTrialCommandHandler> logger
     )
 {
     this.licenseClient              = licenseClient;
     this.deviceIdProvider           = deviceIdProvider;
     this.userInfoProvider           = userInfoProvider;
     this.licenseStorage             = licenseStorage;
     this.publicKeyStorage           = publicKeyStorage;
     this.licenseValidator           = licenseValidator;
     this.licenseInformationProvider = licenseInformationProvider;
     this.logger = logger;
 }
        public CurrentUserDataProvider([NotNull] IAdUserInfoProvider adUserInfoProvider,
                                       [NotNull] IUserInfoProvider userInfoProvider,
                                       [NotNull] IUserPrincipalProvider userPrincipalProvider)
        {
            if (adUserInfoProvider == null)
            {
                throw new ArgumentNullException(nameof(adUserInfoProvider));
            }
            if (userInfoProvider == null)
            {
                throw new ArgumentNullException(nameof(userInfoProvider));
            }
            if (userPrincipalProvider == null)
            {
                throw new ArgumentNullException(nameof(userPrincipalProvider));
            }

            _adUserInfoProvider    = adUserInfoProvider;
            _userInfoProvider      = userInfoProvider;
            _userPrincipalProvider = userPrincipalProvider;
        }
 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;
 }
 public GamesController(ITicTacToeData ticTacToeData, IGameResultValidator resultValidator, IUserInfoProvider userIdProvider)
     : base(ticTacToeData)
 {
     this.resultValidator = resultValidator;
     this.userInfoProvider = userIdProvider;
 }
 public void Init()
 {
     _mockRequestManager = new Mock<IRequestManager>();
     _userInfoProvider = new UserInfoProvider(_mockRequestManager.Object);
 }