public RegistrationService(IUserService userService, IPasswordManagementService passwordManagementService, IAuthorisationService authorisationService) { _userService = userService; _passwordManagementService = passwordManagementService; _authorisationService = authorisationService; }
public SchemasController(IDataSchemaService dataSchemaService, IAuthorisationService auth, IConfigurationService configurationService) : base(auth) { _dataSchemaService = dataSchemaService; _config = configurationService; }
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()); }
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; }
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; }
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); }
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; }
public LicenseTemplatesController(ILicenseTemplatesService licenseTemplatesService, IAuthorisationService auth, IConfigurationService configService) : base(auth) { _templates = licenseTemplatesService; _configService = configService; }
public UserAccountController(IUserManagementService userManagementService, IPasswordManagementService passwordManagementService, IAuthorisationService authorisationService, IStringResourceProvider stringResourceProvider) { _userManagementService = userManagementService; _passwordManagementService = passwordManagementService; _authorisationService = authorisationService; _stringResourceProvider = stringResourceProvider; }
public UserAccountInfoController(IUniquePageService uniquePageService, IUserService userService, IAuthorisationService authorisationService) { _uniquePageService = uniquePageService; _userService = userService; _authorisationService = authorisationService; }
public ConsumerProviderRegistrationController(IAuthorisationService auth, IConsumerProviderRegistrationService registrationService, ILicenseFileProvider licenseService) : base(auth) { _registrationService = registrationService; _licenseService = licenseService; }
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()); }
/// <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; }
public CreateInitialUser(IUserService userService, IRoleService roleService, IAuthorisationService authorisationService, IPasswordManagementService passwordManagementService) { _userService = userService; _roleService = roleService; _authorisationService = authorisationService; _passwordManagementService = passwordManagementService; }
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; }
public CreateInitialUser(IUserManagementService userManagementService, IRoleService roleService, IAuthorisationService authorisationService, IPasswordManagementService passwordManagementService) { _userManagementService = userManagementService; _roleService = roleService; _authorisationService = authorisationService; _passwordManagementService = passwordManagementService; }
public AccountController(IAuthorisationService auth, IConfigurationService configService, IUserService users) : base(auth) { _configService = configService; _users = users; }
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()); }
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)); }
public SoftwareStatementController(IAuthorisationService auth, ISoftwareStatementService softwareStatementService, IDataSchemaService dataSchemaService, IOrganizationLicenseService organizationLicenseService) : base(auth) { _softwareStatementService = softwareStatementService; _dataSchemaService = dataSchemaService; _organizationLicenseService = organizationLicenseService; }
public ApplicationsController( IApplicationsService applicationsService, IAuthorisationService auth, IConfigurationService configuration ) : base(auth) { _applications = applicationsService; _configuration = configuration; }
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; }
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()); }
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); }
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)); }
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 }); }; }
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); }
public RatingService(IAccountService accountService, IAuthorisationService authorisationService) { this.accountService = accountService; this.authorisationService = authorisationService; }
public LogoutControllerBuilder WithAuthorisationService(IAuthorisationService authorisationService) { _authorisationService = authorisationService; return this; }
public AuthorisationProcessor(IAuthorisationService service) { _service = service; }
public LogoutController(IAuthorisationService authorisationService) { _authorisationService = authorisationService; }