Ejemplo n.º 1
0
 public RegistrationService(IUserService userService, IPasswordManagementService passwordManagementService,
                            IAuthorisationService authorisationService)
 {
     _userService = userService;
     _passwordManagementService = passwordManagementService;
     _authorisationService      = authorisationService;
 }
Ejemplo n.º 2
0
 public SchemasController(IDataSchemaService dataSchemaService, IAuthorisationService auth,
                          IConfigurationService configurationService)
     : base(auth)
 {
     _dataSchemaService = dataSchemaService;
     _config            = configurationService;
 }
Ejemplo n.º 3
0
        public SalesArticleModule(
            IFacadeService <SalesArticle, string, SalesArticleResource, SalesArticleResource> salesArticleService,
            ISalesArticleCompositeDiscountFacadeService salesArticleCompositeDiscountFacadeService,
            ISalesArticleService salesArticleProxyService,
            ISalesArticleSerialNumberFacadeService salesArticleSerialNumberFacadeService,
            IAuthorisationService authorisationService)
        {
            this.salesArticleService = salesArticleService;
            this.salesArticleCompositeDiscountFacadeService = salesArticleCompositeDiscountFacadeService;
            this.salesArticleProxyService = salesArticleProxyService;
            this.salesArticleSerialNumberFacadeService = salesArticleSerialNumberFacadeService;
            this.authorisationService = authorisationService;


            this.Get("/products/maint/sales-articles", _ => this.GetSalesArticles());
            this.Get("/products/maint/sales-articles/{id*}", parameters => this.GetSalesArticle(parameters.id));
            this.Put("/products/maint/sales-articles/{id*}", parameters => this.UpdateSalesArticle(parameters.id));
            this.Get(
                "/products/maint/sales-articles/composite-discounts/{id*}",
                parameters => this.GetSalesArticleCompositeDiscount(parameters.id));
            this.Put(
                "/products/maint/sales-articles/composite-discounts/{id*}",
                parameters => this.UpdateSalesArticleCompositeDiscount(parameters.id));

            this.Get(
                "/products/maint/sales-articles/serial-number-details/{id*}",
                parameters => this.GetSerialNumberDetails(parameters.id));
            this.Get("/products/maint/sales-articles-reallocate", _ => this.GetApp());
        }
Ejemplo n.º 4
0
        public void EstablishContext()
        {
            this.ManufacturingRouteService = Substitute.For <IFacadeService <ManufacturingRoute, string, ManufacturingRouteResource, ManufacturingRouteResource> >();
            this.AuthorisationService      = Substitute.For <IAuthorisationService>();
            var bootstrapper = new ConfigurableBootstrapper(
                with =>
            {
                with.Dependency(this.ManufacturingRouteService);
                with.Dependency <IResourceBuilder <ResponseModel <ManufacturingRoute> > >(new ManufacturingRouteResourceBuilder(this.AuthorisationService));
                with.Dependency <IResourceBuilder <ResponseModel <IEnumerable <ManufacturingRoute> > > >(
                    new ManufacturingRoutesResourceBuilder(this.AuthorisationService));
                with.Module <ManufacturingRoutesModule>();
                with.Dependency(this.AuthorisationService);
                with.ResponseProcessor <ManufacturingRoutesResponseProcessor>();
                with.ResponseProcessor <ManufacturingRouteResponseProcessor>();
                with.RequestStartup(
                    (container, pipelines, context) =>
                {
                    var claims = new List <Claim>
                    {
                        new Claim(ClaimTypes.Role, "employee"),
                        new Claim(ClaimTypes.NameIdentifier, "test-user")
                    };

                    var user = new ClaimsIdentity(claims, "jwt");

                    context.CurrentUser = new ClaimsPrincipal(user);
                });
            });

            this.Browser = new Browser(bootstrapper);
        }
 public UserAccountInfoController(IUniquePageService uniquePageService, MrCMS.Services.IUserManagementService userService,
                                  IAuthorisationService authorisationService)
 {
     _uniquePageService    = uniquePageService;
     _userService          = userService;
     _authorisationService = authorisationService;
 }
Ejemplo n.º 6
0
 public LoginService(IUserLookup userLookup, IAuthorisationService authorisationService,
                     IPasswordManagementService passwordManagementService)
 {
     _userLookup                = userLookup;
     _authorisationService      = authorisationService;
     _passwordManagementService = passwordManagementService;
 }
 public WorkstationTopUpStatusResourceBuilder(
     IAuthorisationService authorisationService,
     IWorkstationPack workstationPack)
 {
     this.authorisationService = authorisationService;
     this.workstationPack      = workstationPack;
 }
 public ConsumerRequestsController(IAuthorisationService auth,
                                   IConsumerRequestService requests,
                                   IConfigurationService configService) : base(auth)
 {
     _requests      = requests;
     _configService = configService;
 }
Ejemplo n.º 9
0
        public void EstablishContext()
        {
            this.TariffService        = Substitute.For <ITariffFacadeService>();
            this.AuthorisationService = Substitute.For <IAuthorisationService>();
            this.AuthorisationService.HasPermissionFor(AuthorisedAction.TariffAdmin, Arg.Any <IEnumerable <string> >())
            .Returns(true);
            var bootstrapper = new ConfigurableBootstrapper(
                with =>
            {
                with.Dependency(this.TariffService);
                with.Dependency <IResourceBuilder <ResponseModel <Tariff> > >(new TariffResourceBuilder());
                with.Dependency(this.AuthorisationService);
                with.Dependency <IResourceBuilder <ResponseModel <IEnumerable <Tariff> > > >(new TariffsResourceBuilder());
                with.Dependency <IResourceBuilder <ResponseModel <TariffsReallocator> > >(new TariffsReallocatorResourceBuilder());
                with.Module <TariffModule>();
                with.ResponseProcessor <TariffResponseProcessor>();
                with.ResponseProcessor <TariffsResponseProcessor>();
                with.ResponseProcessor <TariffsReallocatorResponseProcessor>();
                with.RequestStartup(
                    (container, pipelines, context) =>
                {
                    var claims = new List <Claim>
                    {
                        new Claim(ClaimTypes.Role, "employee"),
                        new Claim(ClaimTypes.NameIdentifier, "test-user")
                    };

                    var user = new ClaimsIdentity(claims, "jwt");

                    context.CurrentUser = new ClaimsPrincipal(user);
                });
            });

            this.Browser = new Browser(bootstrapper);
        }
Ejemplo n.º 10
0
        public UserInterface(IRegistrationService registrationService,
                             IAuthorisationService authorizationService,

                             IMaterialInputService materialInputService,
                             ICourseInputService courseInputService,
                             ISkillInputService skillInputService,
                             IUserInfoInputService userInfoInputService,

                             IMaterialService materialService,
                             ICourseService courseService,
                             ISkillService skillService,

                             EducationPortalContext context,
                             Session session)
        {
            this.registrationService  = registrationService;
            this.authorizationService = authorizationService;

            this.materialService = materialService;
            this.courseService   = courseService;
            this.skillService    = skillService;

            this.materialInputService = materialInputService;
            this.courseInputService   = courseInputService;
            this.skillInputService    = skillInputService;
            this.userInfoInputService = userInfoInputService;

            this.context = context;
            this.session = session;
        }
Ejemplo n.º 11
0
 public LicenseTemplatesController(ILicenseTemplatesService licenseTemplatesService,
                                   IAuthorisationService auth,
                                   IConfigurationService configService) : base(auth)
 {
     _templates     = licenseTemplatesService;
     _configService = configService;
 }
Ejemplo n.º 12
0
 public UserAccountController(IUserManagementService userManagementService, IPasswordManagementService passwordManagementService, IAuthorisationService authorisationService, IStringResourceProvider stringResourceProvider)
 {
     _userManagementService     = userManagementService;
     _passwordManagementService = passwordManagementService;
     _authorisationService      = authorisationService;
     _stringResourceProvider    = stringResourceProvider;
 }
Ejemplo n.º 13
0
 public UserAccountInfoController(IUniquePageService uniquePageService, IUserService userService,
                                  IAuthorisationService authorisationService)
 {
     _uniquePageService    = uniquePageService;
     _userService          = userService;
     _authorisationService = authorisationService;
 }
Ejemplo n.º 14
0
 public ConsumerProviderRegistrationController(IAuthorisationService auth,
                                               IConsumerProviderRegistrationService registrationService,
                                               ILicenseFileProvider licenseService) : base(auth)
 {
     _registrationService = registrationService;
     _licenseService      = licenseService;
 }
Ejemplo n.º 15
0
        public BuildPlansModule(
            IFacadeService <BuildPlan, string, BuildPlanResource, BuildPlanResource> buildPlanService,
            IBuildPlansReportFacadeService buildPlansReportService,
            IBuildPlanRulesFacadeService buildPlanRulesService,
            IBuildPlanDetailsService buildPlanDetailsService,
            IAuthorisationService authorisationService)
        {
            this.buildPlanService        = buildPlanService;
            this.buildPlansReportService = buildPlansReportService;
            this.buildPlanRulesService   = buildPlanRulesService;
            this.buildPlanDetailsService = buildPlanDetailsService;
            this.authorisationService    = authorisationService;

            this.Get("/production/maintenance/build-plans", _ => this.GetBuildPlans());
            this.Post("/production/maintenance/build-plans", _ => this.AddBuildPlan());
            this.Put("/production/maintenance/build-plans", _ => this.UpdateBuildPlan());
            this.Get("/production/reports/build-plans", _ => this.GetBuildPlanReportOptions());
            this.Get("/production/reports/build-plans/report", _ => this.GetBuildPlanReport());
            this.Get("/production/maintenance/build-plan-rules", _ => this.GetBuildPlanRules());
            this.Get("/production/maintenance/build-plan-rules/{ruleCode}", parameters => this.GetBuildPlanRule(parameters.ruleCode));
            this.Get("/production/maintenance/build-plan-details", _ => this.GetBuildPlanDetails());
            this.Post("/production/maintenance/build-plan-details", _ => this.AddBuildPlanDetail());
            this.Put("/production/maintenance/build-plan-details", _ => this.UpdateBuildPlanDetail());
            this.Delete("/production/maintenance/build-plan-details", _ => this.DeleteBuildPlanDetail());
        }
Ejemplo n.º 16
0
 public RegistrationService(IUserService userService, IPasswordManagementService passwordManagementService,
                            IAuthorisationService authorisationService)
 {
     _userService = userService;
     _passwordManagementService = passwordManagementService;
     _authorisationService = authorisationService;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OperationAuthorisationFilter" /> class.
 /// </summary>
 /// <param name="authorisationService">An instance of either the <see cref="IAuthorisationService" /> class.</param>
 /// <param name="sessionToken">Session token.</param>
 /// <param name="serviceName">The service name to check permissions.</param>
 /// <param name="permission">The permission requested. Any of: ADMIN, CREATE, DELETE, PROVIDE, QUERY, SUBSCRIBE, UPDATE</param>
 /// <param name="privilege">The access level requested. Any of APPROVED, REJECTED, SUPPORTED</param>
 public OperationAuthorisationFilter(IAuthorisationService authorisationService, string sessionToken, string serviceName, RightType permission, RightValue privilege)
 {
     this.authorisationService = authorisationService;
     this.sessionToken         = sessionToken;
     this.serviceName          = serviceName;
     this.permission           = permission;
     this.privilege            = privilege;
 }
 public OrganizationController(IAuthorisationService auth,
                               IOrganisationsService orgService,
                               IConfigurationService configurationService)
     : base(auth)
 {
     _organisations        = orgService;
     _configurationService = configurationService;
 }
Ejemplo n.º 19
0
 public CreateInitialUser(IUserService userService, IRoleService roleService,
     IAuthorisationService authorisationService, IPasswordManagementService passwordManagementService)
 {
     _userService = userService;
     _roleService = roleService;
     _authorisationService = authorisationService;
     _passwordManagementService = passwordManagementService;
 }
Ejemplo n.º 20
0
 public HomeController(IAuthorisationService auth,
                       IOrganisationsService organisations,
                       IAdminService admin)
     : base(auth)
 {
     _organizationService = organisations;
     _admin = admin;
 }
 public LicenseVerificationController(IAuthorisationService auth,
                                      ILicenseVerificationService licenseVerification,
                                      IOrganizationLicenseService licenseService)
     : base(auth)
 {
     _licenseService      = licenseService;
     _licenseVerification = licenseVerification;
 }
Ejemplo n.º 22
0
 public CreateInitialUser(IUserManagementService userManagementService, IRoleService roleService,
                          IAuthorisationService authorisationService, IPasswordManagementService passwordManagementService)
 {
     _userManagementService     = userManagementService;
     _roleService               = roleService;
     _authorisationService      = authorisationService;
     _passwordManagementService = passwordManagementService;
 }
Ejemplo n.º 23
0
 public AccountController(IAuthorisationService auth,
                          IConfigurationService configService,
                          IUserService users)
     : base(auth)
 {
     _configService = configService;
     _users         = users;
 }
Ejemplo n.º 24
0
        public ManufacturingTimingsModule(
            IManufacturingTimingsFacadeService manufacturingTimingsService, IAuthorisationService authorisationService)
        {
            this.manufacturingTimingsService = manufacturingTimingsService;
            this.authorisationService        = authorisationService;

            this.Get("/production/reports/manufacturing-timings", _ => this.GetTimingsReport());
            this.Get("/production/reports/manufacturing-timings/export", _ => this.GetTimingsExport());
        }
Ejemplo n.º 25
0
 public PartCadInfoModule(
     IFacadeService <Part, string, PartResource, PartResource> partsFacadeService,
     IAuthorisationService authorisationService)
 {
     this.partsFacadeService   = partsFacadeService;
     this.authorisationService = authorisationService;
     this.Get("/production/maintenance/part-cad-info", _ => this.GetPartCadInfo());
     this.Put("/production/maintenance/part-cad-info/{id}", parameters => this.UpdatePart(parameters.id));
 }
Ejemplo n.º 26
0
 public SoftwareStatementController(IAuthorisationService auth,
                                    ISoftwareStatementService softwareStatementService,
                                    IDataSchemaService dataSchemaService,
                                    IOrganizationLicenseService organizationLicenseService) : base(auth)
 {
     _softwareStatementService   = softwareStatementService;
     _dataSchemaService          = dataSchemaService;
     _organizationLicenseService = organizationLicenseService;
 }
Ejemplo n.º 27
0
 public ApplicationsController(
     IApplicationsService applicationsService,
     IAuthorisationService auth,
     IConfigurationService configuration
     ) : base(auth)
 {
     _applications  = applicationsService;
     _configuration = configuration;
 }
Ejemplo n.º 28
0
 public LoginController(IUserService userService, IResetPasswordService resetPasswordService, IAuthorisationService authorisationService, IUniquePageService uniquePageService,
                        ILoginService loginService, IStringResourceProvider stringResourceProvider)
 {
     _userService            = userService;
     _resetPasswordService   = resetPasswordService;
     _authorisationService   = authorisationService;
     _uniquePageService      = uniquePageService;
     _loginService           = loginService;
     _stringResourceProvider = stringResourceProvider;
 }
 public AuthorisationMiddleware(RequestDelegate next,
                                IAuthorisationService authorisationService,
                                IDiagnosticContext diagnosticContext,
                                ILogger <AuthorisationMiddleware> logger)
 {
     _next = next;
     _authorisationService = authorisationService;
     _diagnosticContext    = diagnosticContext;
     _logger = logger;
 }
Ejemplo n.º 30
0
 public VatCodeModule(
     IFacadeService <VatCode, string, VatCodeResource, VatCodeResource> vatCodeService,
     IAuthorisationService authorisationService)
 {
     this.vatCodeService       = vatCodeService;
     this.authorisationService = authorisationService;
     this.Get("/products/maint/vat-codes/{code}", parameters => this.GetVatCodeByCode(parameters.code));
     this.Get("/products/maint/vat-codes/", _ => this.GetVatCodes());
     this.Put("/products/maint/vat-codes/{code}", parameters => this.UpdateVatCode(parameters.code));
     this.Post("/products/maint/vat-codes", _ => this.AddVatCode());
 }
Ejemplo n.º 31
0
        public void EstablishContext()
        {
            this.BuildPlanFacadeService =
                Substitute.For <IFacadeService <BuildPlan, string, BuildPlanResource, BuildPlanResource> >();
            this.BuildPlansReportFacadeService = Substitute.For <IBuildPlansReportFacadeService>();
            this.BuildPlanRulesFacadeService   = Substitute.For <IBuildPlanRulesFacadeService>();
            this.BuildPlanDetailsFacadeService = Substitute
                                                 .For <IFacadeService <BuildPlanDetail, BuildPlanDetailKey, BuildPlanDetailResource, BuildPlanDetailResource> >();
            this.AuthorisationService = Substitute.For <IAuthorisationService>();

            var bootstrapper = new ConfigurableBootstrapper(
                with =>
            {
                with.Dependency(this.BuildPlanFacadeService);
                with.Dependency(this.BuildPlansReportFacadeService);
                with.Dependency(this.BuildPlanRulesFacadeService);
                with.Dependency(this.BuildPlanDetailsFacadeService);
                with.Dependency <IResourceBuilder <ResponseModel <BuildPlan> > >(
                    new BuildPlanResourceBuilder(this.AuthorisationService));
                with.Dependency <IResourceBuilder <ResponseModel <IEnumerable <BuildPlan> > > >(
                    new BuildPlansResourceBuilder(this.AuthorisationService));
                with.Dependency <IResourceBuilder <ResponseModel <BuildPlanRule> > >(
                    new BuildPlanRuleResourceBuilder(this.AuthorisationService));
                with.Dependency <IResourceBuilder <ResponseModel <IEnumerable <BuildPlanRule> > > >(
                    new BuildPlanRulesResourceBuilder(this.AuthorisationService));
                with.Dependency <IResourceBuilder <ResultsModel> >(new ResultsModelResourceBuilder());
                with.Dependency <IResourceBuilder <ResponseModel <BuildPlanDetail> > >(
                    new BuildPlanDetailResourceBuilder(this.AuthorisationService));
                with.Dependency <IResourceBuilder <ResponseModel <IEnumerable <BuildPlanDetail> > > >(
                    new BuildPlanDetailsResourceBuilder(this.AuthorisationService));
                with.Module <BuildPlansModule>();
                with.ResponseProcessor <BuildPlanResponseProcessor>();
                with.ResponseProcessor <BuildPlansResponseProcessor>();
                with.ResponseProcessor <BuildPlanRuleResponseProcessor>();
                with.ResponseProcessor <BuildPlanRulesResponseProcessor>();
                with.ResponseProcessor <BuildPlanDetailResponseProcessor>();
                with.ResponseProcessor <BuildPlanDetailsResponseProcessor>();
                with.ResponseProcessor <ResultsModelJsonResponseProcessor>();
                with.RequestStartup(
                    (container, pipelines, context) =>
                {
                    var claims = new List <Claim>
                    {
                        new Claim(ClaimTypes.Role, "employee"),
                        new Claim(ClaimTypes.NameIdentifier, "test-user")
                    };
                    var user = new ClaimsIdentity(claims, "jwt");

                    context.CurrentUser = new ClaimsPrincipal(user);
                });
            });

            this.Browser = new Browser(bootstrapper);
        }
Ejemplo n.º 32
0
 public SernosNoteModule(
     IFacadeService <SernosNote, int, SernosNoteCreateResource, SernosNoteResource> sernosNoteService,
     IAuthorisationService authorisationService)
 {
     this.sernosNoteService    = sernosNoteService;
     this.authorisationService = authorisationService;
     this.Get("/products/maint/serial-numbers/notes", _ => this.GetSernosNotes());
     this.Get("/products/maint/serial-numbers/notes/{id}", parameters => this.GetSernosNoteById(parameters.id));
     this.Post("/products/maint/serial-numbers/notes", _ => this.AddSernosNote());
     this.Put("/products/maint/serial-numbers/notes/{id}", parameters => this.UpdateSernosNote(parameters.id));
 }
Ejemplo n.º 33
0
        public LoginControllerTests()
        {
            _userService = A.Fake<IUserService>();
            _resetPasswordService = A.Fake<IResetPasswordService>();
            _authorisationService = A.Fake<IAuthorisationService>();
            _loginService = A.Fake<ILoginService>();
            _uniquePageService = A.Fake<IUniquePageService>();
            _loginController = new LoginController(_userService, _resetPasswordService, _authorisationService, _uniquePageService, _loginService, A.Fake<IStringResourceProvider>());

            // initial setup as this is reused
            A.CallTo(() => _uniquePageService.RedirectTo<LoginPage>(null)).Returns(new RedirectResult("~/login-page"));
            A.CallTo(() => _uniquePageService.RedirectTo<ForgottenPasswordPage>(null))
             .Returns(new RedirectResult("~/forgotten-password"));
        }
        public AuthorisationModule(IAuthorisationService authorisationService)
        {
            this.authorisationService = authorisationService;

            Post["/{Key}/Authorisation"] = x =>
            {
                var command = new AuthorisationCredentialsCommand(new AccountContext(x.Key), IPAddress.Parse(Request.Form.IPAddress));
                var authorisation = authorisationService.CreateAuthorisationToken(command);
                return Response.AsJson(new
                {
                    authorisation.TokenKey
                });
            };
        }
Ejemplo n.º 35
0
 public ExternalLoginService(UserManager<User, int> userManager, IAuthorisationService authorisationService)
 {
     _userManager = userManager;
     _authorisationService = authorisationService;
 }
 public void SetUp()
 {
     LogAverageExecutionTimeDecoratorForTest<IAuthorisationService>.ResetRequestCounter();
     _decoratee = MockRepository.GenerateMock<IAuthorisationService>();
     _stopwatch = MockRepository.GenerateMock<ITescoStopwatch>();
     _logger = MockRepository.GenerateMock<ILogger>();
     _clock = MockRepository.GenerateMock<IClock>();
     _clock.Stub(c => c.ApplicationNow).Return(_applicationNow);
     _decorator = new LogAverageExecutionTimeDecorator<IAuthorisationService>(_decoratee, _stopwatch, _logger, _clock, 1);
 }
Ejemplo n.º 37
0
 public RatingService(IAccountService accountService, IAuthorisationService authorisationService)
 {
     this.accountService = accountService;
     this.authorisationService = authorisationService;
 }
Ejemplo n.º 38
0
 public LogoutControllerBuilder WithAuthorisationService(IAuthorisationService authorisationService)
 {
     _authorisationService = authorisationService;
     return this;
 }
 public AuthorisationProcessor(IAuthorisationService service)
 {
     _service = service;
 }
Ejemplo n.º 40
0
 public LogoutController(IAuthorisationService authorisationService)
 {
     _authorisationService = authorisationService;
 }