public static ValueTask EnsureAddOrUpdate(this ISecurityValidator securityValidator, Retrospective retrospective, object entity)
 {
     if (securityValidator == null)
     {
         throw new ArgumentNullException(nameof(securityValidator));
     }
     return(securityValidator.EnsureOperation(retrospective, SecurityOperation.AddOrUpdate, entity));
 }
示例#2
0
 public CastVoteCommandHandler(IReturnDbContextFactory returnDbContext, ICurrentParticipantService currentParticipantService, ISecurityValidator securityValidator, IMediator mediator, IMapper mapper)
 {
     this._returnDbContext           = returnDbContext;
     this._currentParticipantService = currentParticipantService;
     this._securityValidator         = securityValidator;
     this._mediator = mediator;
     this._mapper   = mapper;
 }
示例#3
0
 public GamesFunction(
     ILogger <GamesFunction> log,
     IGamesHandler gamesHandler,
     ISecurityValidator securityValidator)
 {
     _log               = log;
     _gamesHandler      = gamesHandler;
     _securityValidator = securityValidator;
 }
示例#4
0
 public MeFunction(
     ILogger <MeFunction> log,
     IMeHandler meHandler,
     ISecurityValidator securityValidator)
 {
     _log               = log;
     _meHandler         = meHandler;
     _securityValidator = securityValidator;
 }
示例#5
0
 public FriendsFunction(
     ILogger <FriendsFunction> log,
     IFriendsHandler friendHandler,
     ISecurityValidator securityValidator)
 {
     _log               = log;
     _friendsHandler    = friendHandler;
     _securityValidator = securityValidator;
 }
示例#6
0
 public AddNoteCommandHandler(IReturnDbContextFactory returnDbContextFactory, ICurrentParticipantService currentParticipantService, ISecurityValidator securityValidator, IMediator mediator, IMapper mapper, ISystemClock systemClock)
 {
     this._returnDbContextFactory    = returnDbContextFactory;
     this._currentParticipantService = currentParticipantService;
     this._securityValidator         = securityValidator;
     this._mediator    = mediator;
     this._mapper      = mapper;
     this._systemClock = systemClock;
 }
示例#7
0
 public SettingsFunction(
     ILogger <SettingsFunction> log,
     ISettingsHandler settingsHandler,
     ISecurityValidator securityValidator)
 {
     _log               = log;
     _settingsHandler   = settingsHandler;
     _securityValidator = securityValidator;
 }
 protected void Inherit(ISecurityValidator <T> validator, string propertyName = "{root}")
 {
     Argument.NotNull(validator, "validator");
     Custom(o =>
     {
         var validationResult = validator.Validate(o);
         if (validationResult.IsValid)
         {
             return(null);
         }
         var error = string.Join(Environment.NewLine, validationResult.Errors.Select(x => x.ErrorMessage));
         return(new ValidationFailure(propertyName, error));
     });
 }
示例#9
0
 public HttpCliUpdater(ISettingsProvider settingsProvider, IDownloadService downloadService,
                       IFileSystem fileSystem, ISecurityValidator securityValidator,
                       IFileUnpackService fileUnpackService, IUserInterface userInterface,
                       IEnvironmentService environmentService,
                       IProcessManager processManager,
                       IBinariesLocator binariesLocator, IEnumerable <IInstallationStep> installationSteps)
 {
     this.settingsProvider   = settingsProvider;
     this.downloadService    = downloadService;
     this.fileSystem         = fileSystem;
     this.securityValidator  = securityValidator;
     this.fileUnpackService  = fileUnpackService;
     this.userInterface      = userInterface;
     this.environmentService = environmentService;
     this.processManager     = processManager;
     this.binariesLocator    = binariesLocator;
     this.installationSteps  = installationSteps;
 }
示例#10
0
 public PingFunction(ISecurityValidator securityValidator)
 {
     _securityValidator = securityValidator;
 }
示例#11
0
 public UpdateNoteCommandHandler(IReturnDbContextFactory returnDbContext, IMediator mediator, ISecurityValidator securityValidator, ITextAnonymizingService textAnonymizingService)
 {
     this._returnDbContext        = returnDbContext;
     this._mediator               = mediator;
     this._securityValidator      = securityValidator;
     this._textAnonymizingService = textAnonymizingService;
 }
示例#12
0
 public UpdateLanguageFile()
 {
     _securityValidator       = ServiceLocator.Current.GetInstance <ISecurityValidator>();
     _languageFileUpdater     = ServiceLocator.Current.GetInstance <ILanguageFileUpdater>();
     _languageLocationService = ServiceLocator.Current.GetInstance <ILanguageLocationService>();
 }
示例#13
0
 public UpdateNoteGroupCommandHandler(IReturnDbContextFactory returnDbContextFactory, ISecurityValidator securityValidator, IMediator mediator)
 {
     this._returnDbContextFactory = returnDbContextFactory;
     this._securityValidator      = securityValidator;
     this._mediator = mediator;
 }
 public UpdateLanguageFile()
 {
     _securityValidator = ServiceLocator.Current.GetInstance<ISecurityValidator>();
     _languageFileUpdater = ServiceLocator.Current.GetInstance<ILanguageFileUpdater>();
     _languageLocationService = ServiceLocator.Current.GetInstance<ILanguageLocationService>();
 }
示例#15
0
 public SecurityValidatorTests()
 {
     this._currentParticipantService = new MockCurrentParticipantService();
     this._securityValidator         = new SecurityValidator(this._currentParticipantService, TestLogger.For <SecurityValidator>());
 }