/// <summary>
 /// Initializes a new instance of the <see cref="AuditLogApiController"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 public AuditLogApiController(IMerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     Mandate.ParameterNotNull(merchelloContext, "merchelloContext");
     _auditLogService = merchelloContext.Services.AuditLogService;
     _merchelloHelper = new MerchelloHelper(merchelloContext.Services);
 }
示例#2
0
 public Logged(IAuditLogService service, IUnitOfWork unitOfWork, Operations operations, ObjectTypeEnum objectType)
 {
     _service         = service;
     this._operations = operations;
     this._objectType = objectType;
     _unityOfWork     = unitOfWork;
 }
 public UpdateOrganisationParentCompanyGuaranteeHandler(ILogger <UpdateOrganisationParentCompanyGuaranteeHandler> logger,
                                                        IUpdateOrganisationRepository updateOrganisationRepository, IAuditLogService auditLogService)
 {
     _logger = logger;
     _updateOrganisationRepository = updateOrganisationRepository;
     _auditLogService = auditLogService;
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuditLogApiController"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 public AuditLogApiController(IMerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     Mandate.ParameterNotNull(merchelloContext, "merchelloContext");
     _auditLogService = merchelloContext.Services.AuditLogService;
     _merchelloHelper = new MerchelloHelper(merchelloContext.Services);
 }
示例#5
0
 public DocumentController(
     IAlfrescoHttpClient alfrescoHttpClient,
     IAuditLogService auditLogService,
     IComponentService componentService,
     IDocumentService documentService,
     IIdentityUser identityUser,
     INodesService nodesService,
     ISpisUmConfiguration spisUmConfiguration,
     ITransactionHistoryService transactionHistory,
     IShipmentsService shipmentsService,
     IValidationService validationService,
     IAlfrescoModelComparer alfrescoModelComparer,
     ITranslateService translateService
     )
 {
     _alfrescoHttpClient    = alfrescoHttpClient;
     _auditLogService       = auditLogService;
     _componentService      = componentService;
     _documentService       = documentService;
     _identityUser          = identityUser;
     _nodesService          = nodesService;
     _shipmentsService      = shipmentsService;
     _spisUmConfiguration   = spisUmConfiguration;
     _transactionHistory    = transactionHistory;
     _validationService     = validationService;
     _alfrescoModelComparer = alfrescoModelComparer;
     _translateService      = translateService;
 }
示例#6
0
 public LogController(ILogService logService,
                      ILogger <ConfigurationController> logger,
                      IAuditLogService auditLogService) : base(logger)
 {
     _logService      = logService;
     _auditLogService = auditLogService;
 }
示例#7
0
 public SignerService(
     ISignerClient signerClient,
     ISimpleMemoryCache simpleMemoryCache,
     IAlfrescoConfiguration alfrescoConfiguration,
     IPersonService personService,
     IIdentityUser identityUser,
     IMapper mapper,
     ITransactionHistoryService transactionHistoryService,
     IAuditLogService auditLogService,
     IRepositoryService repositoryService,
     IAlfrescoHttpClient alfrescoHttpClient,
     IPdfService pdfService,
     ISystemLoginService systemLoginService
     )
 {
     _signerClient          = signerClient;
     _simpleMemoryCache     = simpleMemoryCache;
     _alfrescoConfiguration = alfrescoConfiguration;
     _personService         = personService;
     _identityUser          = identityUser;
     _mapper = mapper;
     _transactionHistoryService = transactionHistoryService;
     _auditLogService           = auditLogService;
     _repositoryService         = repositoryService;
     _alfrescoHttpClient        = alfrescoHttpClient;
     _pdfService         = pdfService;
     _systemLoginService = systemLoginService;
 }
 public UpdateOrganisationFinancialTrackRecordHandler(ILogger <UpdateOrganisationFinancialTrackRecordHandler> logger,
                                                      IUpdateOrganisationRepository updateOrganisationRepository, IAuditLogService auditLogService)
 {
     _logger = logger;
     _updateOrganisationRepository = updateOrganisationRepository;
     _auditLogService = auditLogService;
 }
 public LockingController(ILogger <LockingController> logger, IUserAccessService userAccessService,
                          ILockingService lockingService, IAuditLogService auditLogService)
 {
     _logger            = logger;
     _auditLogService   = auditLogService;
     _lockingService    = lockingService;
     _userAccessService = userAccessService;
 }
 public UpdateOrganisationHandler(ILogger <UpdateOrganisationHandler> logger, IUpdateOrganisationRepository updateOrganisationRepository, IAuditLogService auditLogService, IOrganisationValidator organisationValidator, ITextSanitiser textSanitiser)
 {
     _logger = logger;
     _updateOrganisationRepository = updateOrganisationRepository;
     _auditLogService       = auditLogService;
     _organisationValidator = organisationValidator;
     _textSanitiser         = textSanitiser;
 }
示例#11
0
 public DashboardController(IGmailUserDataService gmailUserDataService, IUserService userService, UserManager <User> userManager, IUserViewModelMapper <User, UserViewModel> userMapper, IAuditLogService auditLogService)
 {
     this.gmailUserDataService = gmailUserDataService ?? throw new ArgumentNullException(nameof(gmailUserDataService));
     this.userService          = userService ?? throw new ArgumentNullException(nameof(userService));
     this.userManager          = userManager ?? throw new ArgumentNullException(nameof(userManager));
     this.userMapper           = userMapper ?? throw new ArgumentNullException(nameof(userMapper));
     this.auditLogService      = auditLogService ?? throw new ArgumentNullException(nameof(auditLogService));
 }
 public UpdateOrganisationApplicationDeterminedDateHandler(ILogger <UpdateOrganisationApplicationDeterminedDateHandler> logger,
                                                           IOrganisationValidator validator, IUpdateOrganisationRepository updateOrganisationRepository, IAuditLogService auditLogService)
 {
     _logger    = logger;
     _validator = validator;
     _updateOrganisationRepository = updateOrganisationRepository;
     _auditLogService = auditLogService;
 }
 public UpdateOrganisationProviderTypeHandler(ILogger <UpdateOrganisationProviderTypeHandler> logger,
                                              IOrganisationValidator validator, IUpdateOrganisationRepository updateOrganisationRepository,
                                              IAuditLogService auditLogService)
 {
     _logger    = logger;
     _validator = validator;
     _updateOrganisationRepository = updateOrganisationRepository;
     _auditLogService = auditLogService;
 }
示例#14
0
 public ComponentService(IAlfrescoHttpClient alfrescoHttpClient, INodesService nodesService, IPersonService personService,
                         IIdentityUser identityUser, IAuditLogService auditLogService)
 {
     _alfrescoHttpClient = alfrescoHttpClient;
     _nodesService       = nodesService;
     _personService      = personService;
     _identityUser       = identityUser;
     _auditLogService    = auditLogService;
 }
 public UpdateOrganisationLegalNameHandler(ILogger <UpdateOrganisationLegalNameHandler> logger,
                                           IOrganisationValidator validator, IUpdateOrganisationRepository updateOrganisationRepository,
                                           ITextSanitiser textSanitiser, IAuditLogService auditLogService)
 {
     _logger    = logger;
     _validator = validator;
     _updateOrganisationRepository = updateOrganisationRepository;
     _textSanitiser   = textSanitiser;
     _auditLogService = auditLogService;
 }
示例#16
0
 public AuditLogActionFilter(
     IAuditLogService auditLogService,
     //ISession Session,
     ILogger <AuditLogActionFilter> logger
     )
 {
     //_Session = Session;
     _logger          = logger;
     _auditLogService = auditLogService;
 }
示例#17
0
 public AuditActionFilter(IAuditLogService auditLogService,
                          IAdmSession admSession,
                          ILogger <AuditActionFilter> logger,
                          IClientInfoProvider clientInfoProvider)
 {
     _auditLogService    = auditLogService;
     _admSession         = admSession;
     _logger             = logger;
     _clientInfoProvider = clientInfoProvider;
 }
 public PublishEventService(ILogger <PublishEventService> logger,
                            IDateTimeProvider dateTimeProvider,
                            IRepository <EventLog, long> eventLogRepository,
                            IAuditLogService externalAuditLogService)
 {
     _logger                  = logger;
     _dateTimeProvider        = dateTimeProvider;
     _eventLogRepository      = eventLogRepository;
     _externalAuditLogService = externalAuditLogService;
 }
        public AuditLogService_Test()
        {
            _auditLogService = Resolve <IAuditLogService>();

            /*
             * Task<ReturnModel<AuditLogDto>> GetAuditLogTable(RequestModel<object> input, int tenantId);
             * Task<AuditLogDto> GetAuditLogDetails(long id, int tenantId);
             * AuditLogTimeOutput GetAuditLogTimes(int? count, int tenantId);
             */
        }
示例#20
0
        public async Task <IActionResult> AddUsersToGroups(UsersGroupsIdsDTO model, [FromServices] IAuditLogService auditLogger)
        {
            List <ApplicationUser> users = new List <ApplicationUser>();

            foreach (var userId in model.UserIds)
            {
                var userInDb = await db.Users.FindAsync(userId);

                if (userInDb == null)
                {
                    return(BadRequest());
                }
                users.Add(userInDb);
            }
            List <Group> groups = new List <Group>();

            foreach (var groupId in model.GroupIds)
            {
                var groupInDb = await db.Groups.FindAsync(groupId);

                if (groupInDb == null)
                {
                    return(BadRequest());
                }
                groups.Add(groupInDb);
            }

            try
            {
                db.AuditDisabled = true;
                foreach (var user in users) // add each user to each group
                {
                    foreach (var group in groups)
                    {
                        if (!await db.UserGroups.AnyAsync(ug => ug.UserId == user.Id && ug.GroupId == group.GroupId))                               // if not already in group
                        {
                            await auditLogger.CreateAsync($"Added user: {user.UserName} to group: {group.Name}", "Adding users to groups", "User"); // log for each change

                            //await auditLogger.CreateAsync($"Added user: {user.UserName} to group: {group.Name}", "Adding users to groups", "User"); // log for each change
                            await db.UserGroups.AddAsync(new UserGroup { UserId = user.Id, GroupId = group.GroupId });
                        }
                    }
                }
                await db.SaveChangesAsync();

                await auditLogger.SaveAsync(); // save all logs after successful save

                return(Ok());
            }
            catch (Exception ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }
示例#21
0
 public AuditInterceptor(
     IAuditLogService auditLogService,
     IAuthenticator authenticator,
     IUserIpAccessor userIpAccessor,
     IOptions <AuditInterceptorOptions> options)
 {
     _auditLogService = auditLogService;
     _authenticator   = authenticator;
     _userIpAccessor  = userIpAccessor;
     _predicates      = options.Value.Predicates ?? new List <AspectPredicate>();
 }
示例#22
0
 public FilterAppService(
     IFilterService domainService,
     IAgentService agentService,
     INotificationManager notificationManager,
     IAuditLogService auditLogService
     )
 {
     _domainService       = domainService;
     _agentService        = agentService;
     _notificationManager = notificationManager;
     _auditLogService     = auditLogService;
 }
示例#23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InvoiceApiController"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 public InvoiceApiController(IMerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _storeSettingService = MerchelloContext.Services.StoreSettingService as StoreSettingService;
     _invoiceService      = merchelloContext.Services.InvoiceService;
     _productService      = merchelloContext.Services.ProductService;
     _noteService         = merchelloContext.Services.NoteService;
     _orderService        = merchelloContext.Services.OrderService;
     _shipmentService     = merchelloContext.Services.ShipmentService;
     _auditLogService     = merchelloContext.Services.AuditLogService;
     _merchello           = new MerchelloHelper(merchelloContext, false);
 }
 public ShipmentController(
     IAuditLogService auditLogService,
     IShipmentsService shipmentsService,
     ISpisUmConfiguration spisUmConfiguration,
     ITranslateService translateService
     )
 {
     _auditLogService     = auditLogService;
     _shipmentsService    = shipmentsService;
     _spisUmConfiguration = spisUmConfiguration;
     _translateService    = translateService;
 }
示例#25
0
 public UpdateOrganisationStatusHandler(ILogger <UpdateOrganisationStatusHandler> logger,
                                        IOrganisationValidator validator, IUpdateOrganisationRepository updateOrganisationRepository,
                                        ILookupDataRepository lookupDataRepository, IOrganisationRepository organisationRepository,
                                        IAuditLogService auditLogService, IEventsRepository eventsRepository)
 {
     _logger    = logger;
     _validator = validator;
     _updateOrganisationRepository = updateOrganisationRepository;
     _lookupDataRepository         = lookupDataRepository;
     _organisationRepository       = organisationRepository;
     _auditLogService  = auditLogService;
     _eventsRepository = eventsRepository;
 }
 public PublishEventService(ILogger <PublishEventService> logger,
                            IDateTimeProvider dateTimeProvider,
                            IRepository <EventLog, long> eventLogRepository,
                            IMessageSender <FileUploadedEvent> fileUploadedEventSender,
                            IMessageSender <FileDeletedEvent> fileDeletedEventSender,
                            IAuditLogService externalAuditLogService)
 {
     _logger                  = logger;
     _dateTimeProvider        = dateTimeProvider;
     _eventLogRepository      = eventLogRepository;
     _fileUploadedEventSender = fileUploadedEventSender;
     _fileDeletedEventSender  = fileDeletedEventSender;
     _externalAuditLogService = externalAuditLogService;
 }
示例#27
0
 public CreateCompanyHandler(IUnitOfWorkFactory unitOfWorkFactory, IDbContextFactory dbContextFactory,
                             IDateTimeProvider dateTimeProvider, IRepository <FieldMetadata> fieldMetadataRepository, IFieldDataRepository fieldDataRepository,
                             INamedServiceFactory <IClassifierRepository> classifierRepositoryFactory, IDocumentService documentRepository,
                             IAuditLogService auditLogService, IBackgroundJobManager jobManager)
 {
     _unitOfWorkFactory           = unitOfWorkFactory;
     _dbContextFactory            = dbContextFactory;
     _dateTimeProvider            = dateTimeProvider;
     _fieldMetadataRepository     = fieldMetadataRepository;
     _fieldDataRepository         = fieldDataRepository;
     _classifierRepositoryFactory = classifierRepositoryFactory;
     _documentRepository          = documentRepository;
     _auditLogService             = auditLogService;
     _jobManager = jobManager;
 }
示例#28
0
 public ConceptService(IAlfrescoHttpClient alfrescoHttpClient,
                       INodesService nodesService,
                       ITransactionHistoryService transactionHistoryService,
                       IIdentityUser identityUser,
                       IComponentService componentService,
                       IDocumentService documentService,
                       IAuditLogService auditLogService
                       )
 {
     _alfrescoHttpClient        = alfrescoHttpClient;
     _nodesService              = nodesService;
     _transactionHistoryService = transactionHistoryService;
     _identityUser              = identityUser;
     _componentService          = componentService;
     _documentService           = documentService;
     _auditLogService           = auditLogService;
 }
示例#29
0
 public FileController(
     IAlfrescoHttpClient alfrescoHttpClient,
     IAuditLogService auditLogService,
     IFileService fileService,
     IIdentityUser identityUser,
     INodesService nodesService,
     IShipmentsService shipmentsService,
     ITransactionHistoryService transactionHistoryService
     )
 {
     _alfrescoHttpClient        = alfrescoHttpClient;
     _auditLogService           = auditLogService;
     _fileService               = fileService;
     _identityUser              = identityUser;
     _nodesService              = nodesService;
     _shipmentsService          = shipmentsService;
     _transactionHistoryService = transactionHistoryService;
 }
示例#30
0
        public override async Task Invoke(AspectContext context, AspectDelegate next)
        {
            _ = context ?? throw new ArgumentNullException(nameof(context));
            _ = next ?? throw new ArgumentNullException(nameof(next));
            IAuditLogService auditLogService = context.ServiceProvider.GetRequiredService <IAuditLogService>();
            ITimeService     timeService     = context.ServiceProvider.GetRequiredService <ITimeService>();

            var record = new AuditLogRecord
            {
                ApplicationName =
                    this.ApplicationName ?? context.ServiceProvider.GetRequiredService <IHostEnvironment>().ApplicationName,
                FunctionName  = this.FunctionName ?? context.ImplementationMethod.DeclaringType.FullName,
                OperationName = this.OperationName ?? context.ServiceMethod.Name,
                StartTime     = await timeService.Current(),
                Operator      = Thread.CurrentPrincipal?.Identity?.Name,
                RequestIp     = "127.0.0.1",
                Arguments     = buildInputArguments(context)
            };

            try
            {
                await next.Invoke(context);

                record.Success = true;
                record.Message = this.BuildMessage(context);
                record.EndTime = await timeService.Current();

                record.Result = buildResult(context);
                await auditLogService.LogRecord(record);
            }
            catch (Exception e)
            {
                record.Message = e.Message;
                record.Success = false;
                record.EndTime = await timeService.Current();

                record.Result = ExceptionInfo.FromException(e);
                await auditLogService.LogRecord(record);

                throw;
            }
        }
示例#31
0
 public HomeController(UserManager <User> userManager,
                       IGmailApiService gmailApiService,
                       IGmailUserDataService gmailUserDataService,
                       IEmailService emailService,
                       IViewModelMapper <Email, EmailViewModel> emailViewModelMapper,
                       IUserService userService,
                       IAuditLogService auditLogService,
                       IStatusService statusService,
                       ILogger <User> logger,
                       ICustomerService customerService)
 {
     this.userManager          = userManager ?? throw new ArgumentNullException(nameof(userManager));
     this.gmailApiService      = gmailApiService ?? throw new ArgumentNullException(nameof(gmailApiService));
     this.gmailUserDataService = gmailUserDataService ?? throw new ArgumentNullException(nameof(gmailUserDataService));
     this.emailService         = emailService ?? throw new ArgumentNullException(nameof(emailService));
     this.emailViewModelMapper = emailViewModelMapper ?? throw new ArgumentNullException(nameof(emailViewModelMapper));
     this.userService          = userService ?? throw new ArgumentNullException(nameof(userService));
     this.auditLogService      = auditLogService ?? throw new ArgumentNullException(nameof(auditLogService));
     this.statusService        = statusService ?? throw new ArgumentNullException(nameof(statusService));
     this.logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     this.customerService = customerService ?? throw new ArgumentNullException(nameof(customerService));
 }