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;
        }
        public GetTaskResultsQueryHandler([NotNull] IQueryExecutor queryExecutor,
                                          [NotNull] ITaskRepository taskRepository,
                                          [NotNull] IUserAuthorityValidator userAuthorityValidator,
                                          [NotNull] IUserProvider userProvider,
                                          [NotNull] IUserRoleProvider userRoleProvider)
        {
            if (queryExecutor == null)
            {
                throw new ArgumentNullException(nameof(queryExecutor));
            }
            if (taskRepository == null)
            {
                throw new ArgumentNullException(nameof(taskRepository));
            }
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (userProvider == null)
            {
                throw new ArgumentNullException(nameof(userProvider));
            }
            if (userRoleProvider == null)
            {
                throw new ArgumentNullException(nameof(userRoleProvider));
            }

            _queryExecutor          = queryExecutor;
            _taskRepository         = taskRepository;
            _userAuthorityValidator = userAuthorityValidator;
            _userProvider           = userProvider;
            _userRoleProvider       = userRoleProvider;
        }
Beispiel #3
0
        //  private readonly FrontPanels _frontPanels;

        public FrontController(IHostingEnvironment hostingEnvironment, IUserRoleProvider userRoleProvider
                               , IRoleProvider roleProvider
                               , IUserProvider userProvider
                               , IClassificationValueProvider classificationValueProvider
                               , IOrganizationProvider organizationProvider
                               , IPersonProvider personProvider
                               , IProjectProvider projectProvider
                               , IFrontUserPreferenceProvider frontUserPreferenceProvider
                               , IProcessProvider processProvider
                               , IFrontProcessProvider frontProcessProvider
                               , IContentProvider contentProvider
                               , IClaimCheck claimCheck
                               , IFrontProvider frontProvider
                               , Microsoft.AspNetCore.Identity.UserManager <SIPx.API.Models.SipUser> userManager)
        {
            _hostingEnvironment          = hostingEnvironment;
            _userRoleProvider            = userRoleProvider;
            _roleProvider                = roleProvider;
            _userProvider                = userProvider;
            _classificationValueProvider = classificationValueProvider;
            _organizationProvider        = organizationProvider;
            _personProvider              = personProvider;
            _projectProvider             = projectProvider;
            _frontUserPreferenceProvider = frontUserPreferenceProvider;
            _processProvider             = processProvider;
            _frontProcessProvider        = frontProcessProvider;
            _contentProvider             = contentProvider;
            _claimCheck    = claimCheck;
            _frontProvider = frontProvider;
            _userManager   = userManager;
        }
Beispiel #4
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 AssessmentViewModelBuilder(IDateTimeProvider dateTimeProvider, IClinicalSystemIdDescriptionProvider clinicalSystemIdDescriptionProvider, IUserPrincipalProvider userPrincipalProvider, IUserRoleProvider userRoleProvider)
 {
     _dateTimeProvider = dateTimeProvider;
     _clinicalSystemIdDescriptionProvider = clinicalSystemIdDescriptionProvider;
     _userPrincipalProvider = userPrincipalProvider;
     _userRoleProvider      = userRoleProvider;
 }
        public GetProjectTasksQueryHandler([NotNull] IQueryExecutor queryExecutor,
                                           [NotNull] IUserAuthorityValidator userAuthorityValidator,
                                           [NotNull] IUserProvider userProvider,
                                           [NotNull] IUserRoleProvider userRoleProvider)
        {
            if (queryExecutor == null)
            {
                throw new ArgumentNullException(nameof(queryExecutor));
            }
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (userProvider == null)
            {
                throw new ArgumentNullException(nameof(userProvider));
            }
            if (userRoleProvider == null)
            {
                throw new ArgumentNullException(nameof(userRoleProvider));
            }

            _queryExecutor          = queryExecutor;
            _userAuthorityValidator = userAuthorityValidator;
            _userProvider           = userProvider;
            _userRoleProvider       = userRoleProvider;
        }
        public void Setup()
        {
            _userRoleProvider = A.Fake <IUserRoleProvider>();

            var controllerContext = A.Fake <ControllerContext>();
            var actionDescriptor  = A.Fake <ActionDescriptor>();

            _filterContext = new AuthorizationContext(controllerContext, actionDescriptor);
        }
Beispiel #8
0
 public UserProvider(
     IUserRepository userRepository,
     IRoleRepository roleRepository,
     IUserRoleProvider userRoleProvider)
 {
     _userRepository   = userRepository;
     _roleRepository   = roleRepository;
     _userRoleProvider = userRoleProvider;
 }
        public void Setup()
        {
            A.Fake<IQueryDispatcher>();
            _userPrincipalProvider = A.Fake<IUserPrincipalProvider>();
            _userRoleProvider = A.Fake<IUserRoleProvider>();
            _assessmentHelper = A.Fake<IAssessmentHelper>();

            _assessmentCompleteActionFilter = new AssessmentCompleteActionFilter("assessmentId", _userPrincipalProvider, _userRoleProvider, _assessmentHelper);
        }
Beispiel #10
0
 public FrontProcessToDoLogic(IProjectProvider projectProvider, IOrganizationProvider organizationProvider, IUserRoleProvider userRoleProvider, IRoleProvider roleProvider, IUserProvider userProvider, IProcessProvider ProcessProvider, IFrontProcessProvider frontProcessProvider)
 {
     _projectProvider      = projectProvider;
     _organizationProvider = organizationProvider;
     _userRoleProvider     = userRoleProvider;
     _roleProvider         = roleProvider;
     _userProvider         = userProvider;
     _processProvider      = ProcessProvider;
     _frontProcessProvider = frontProcessProvider;
 }
        public AssessmentCompleteActionFilter(string actionParameterId, IUserPrincipalProvider userPrincipalProvider, IUserRoleProvider userRoleProvider, IAssessmentHelper assessmentHelper)
        {
            if (string.IsNullOrWhiteSpace(actionParameterId))
            {
                throw new ArgumentNullException();
            }

            _userPrincipalProvider = userPrincipalProvider;
            _userRoleProvider      = userRoleProvider;
            _assessmentHelper      = assessmentHelper;
            _actionParameterId     = actionParameterId;
        }
Beispiel #12
0
        public void Setup()
        {
            Mapper.AddProfile(new AutomapperMappingProfile());

            _clinicalSystemIdDescriptionProvider = A.Fake <IClinicalSystemIdDescriptionProvider>();
            _userRoleProvider   = A.Fake <IUserRoleProvider>();
            _dateOfBirthBuilder = A.Fake <IDateOfBirthBuilder>();

            A.CallTo(() => _clinicalSystemIdDescriptionProvider.GetDescription()).Returns(Description);
            A.CallTo(() => _dateOfBirthBuilder.BuildDateOfBirthViewModel(null)).Returns(new DateOfBirthViewModel());

            _builder = new PatientViewModelBuilder(_clinicalSystemIdDescriptionProvider, _userRoleProvider, _dateOfBirthBuilder);
        }
Beispiel #13
0
        public void Setup()
        {
            Mapper.AddProfile(new AutomapperMappingProfile());

            _dateTimeProvider = A.Fake <IDateTimeProvider>();
            A.CallTo(() => _dateTimeProvider.Now).Returns(new DateTime(2015, 1, 1));

            _clinicalSystemIdDescriptionProvider = A.Fake <IClinicalSystemIdDescriptionProvider>();
            A.CallTo(() => _clinicalSystemIdDescriptionProvider.GetDescription()).Returns(Description);

            _userPrincipalProvider = A.Fake <IUserPrincipalProvider>();
            _userRoleProvider      = A.Fake <IUserRoleProvider>();

            _builder = new AssessmentViewModelBuilder(_dateTimeProvider, _clinicalSystemIdDescriptionProvider, _userPrincipalProvider, _userRoleProvider);
        }
Beispiel #14
0
 public FrontProcessController(IUserRoleProvider userRoleProvider
                               , IProcessTypeStageTypeProvider processTypeStageTypeProvider
                               , IPersonProvider personProvider
                               , IRoleProvider roleProvider
                               , ISecurityLevelProvider securityLevelProvider
                               , IClassificationValueProvider classificationValueProvider
                               , IClassificationProvider classificationProvider
                               , IContentProvider contentProvider
                               , ILanguageProvider languageProvider
                               , IMasterListProvider masterListProvider
                               , IOrganizationProvider organizationProvider
                               , IUserProvider userProvider
                               , IProjectProvider projectProvider
                               , IClaimCheck claimCheck
                               , IFrontProcessProvider frontProcessProvider
                               , IProcessProvider processProvider
                               , Microsoft.AspNetCore.Identity.UserManager <SIPx.API.Models.SipUser> userManager)
 {
     _userRoleProvider             = userRoleProvider;
     _processTypeStageTypeProvider = processTypeStageTypeProvider;
     _personProvider              = personProvider;
     _roleProvider                = roleProvider;
     _securityLevelProvider       = securityLevelProvider;
     _classificationValueProvider = classificationValueProvider;
     _classificationProvider      = classificationProvider;
     _contentProvider             = contentProvider;
     _languageProvider            = languageProvider;
     _masterListProvider          = masterListProvider;
     _organizationProvider        = organizationProvider;
     _userProvider                = userProvider;
     _projectProvider             = projectProvider;
     _claimCheck           = claimCheck;
     _frontProcessProvider = frontProcessProvider;
     _processProvider      = processProvider;
     _userManager          = userManager;
 }
Beispiel #15
0
 public PatientViewModelBuilder(IClinicalSystemIdDescriptionProvider clinicalSystemIdDescriptionProvider, IUserRoleProvider userRoleProvider, IDateOfBirthBuilder dateOfBirthBuilder)
 {
     _clinicalSystemIdDescriptionProvider = clinicalSystemIdDescriptionProvider;
     _userRoleProvider   = userRoleProvider;
     _dateOfBirthBuilder = dateOfBirthBuilder;
 }
Beispiel #16
0
 protected RoleBasedUserSecurity(IUserRoleProvider roleProvider)
 {
     this.roleProvider = roleProvider;
 }
 public AuthorizeAdministratorAttribute(IUserRoleProvider userRoleProvider)
 {
     _userRoleProvider = userRoleProvider;
 }
Beispiel #18
0
 public UserRoleController(IUserRoleProvider userRoleProvider, IClaimCheck claimCheck, Microsoft.AspNetCore.Identity.UserManager <SIPx.API.Models.SipUser> userManager)
 {
     _userRoleProvider = userRoleProvider;
     _claimCheck       = claimCheck;
     _userManager      = userManager;
 }