Example #1
0
        public void EnableAuditingPage()
        {
            var options = new AuditingOptions();

            options.GetOption <bool>(nameof(AuditingOptionsExtensions.IsAuditingPage)).ShouldBeFalse();
            options.EnableAuditingPage();
            options.GetOption <bool>(nameof(AuditingOptionsExtensions.IsAuditingPage)).ShouldBeTrue();
        }
Example #2
0
        public void IsAuditingPage()
        {
            var options = new AuditingOptions();

            options.IsAuditingPage().ShouldBeFalse();
            options.EnableAuditingPage();
            options.IsAuditingPage().ShouldBeTrue();
            options.DisableAuditingPage();
            options.IsAuditingPage().ShouldBeFalse();
        }
Example #3
0
        public void DisableAuditingController()
        {
            var options = new AuditingOptions();

            options.GetOption <bool>(nameof(AuditingOptionsExtensions.IsAuditingController)).ShouldBeFalse();
            options.EnableAuditingController();
            options.GetOption <bool>(nameof(AuditingOptionsExtensions.IsAuditingController)).ShouldBeTrue();
            options.DisableAuditingController();
            options.GetOption <bool>(nameof(AuditingOptionsExtensions.IsAuditingController)).ShouldBeFalse();
        }
Example #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="auditingHelper"></param>
 /// <param name="auditingManager"></param>
 /// <param name="options"></param>
 /// <param name="principalAccessor"></param>
 public AuditingInterceptor(IAuditingHelper auditingHelper,
                            IAuditingManager auditingManager,
                            IOptions <AuditingOptions> options,
                            ICurrentPrincipalAccessor principalAccessor
                            )
 {
     _auditingHelper    = auditingHelper;
     _auditingManager   = auditingManager;
     _principalAccessor = principalAccessor;
     _options           = options.Value;
 }
Example #5
0
 public AuditingManager(
     IAmbientScopeProvider <IAuditScope> ambientScopeProvider,
     IAuditingHelper auditingHelper,
     IAuditingStore auditingStore,
     IServiceProvider serviceProvider,
     IOptions <AuditingOptions> options)
 {
     _ambientScopeProvider = ambientScopeProvider;
     _auditingHelper       = auditingHelper;
     _auditingStore        = auditingStore;
     _serviceProvider      = serviceProvider;
     _options = options.Value;
     Logger   = NullLogger <AuditingManager> .Instance;
 }
Example #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="auditSerializer"></param>
        /// <param name="options"></param>
        /// <param name="clock"></param>
        /// <param name="auditingStore"></param>
        /// <param name="logger"></param>
        /// <param name="principalAccessor"></param>
        /// <param name="serviceProvider"></param>
        public AuditingHelper(
            IAuditSerializer auditSerializer,
            IOptions <AuditingOptions> options,
            IClock clock,
            IAuditingStore auditingStore,
            ILogger <AuditingHelper> logger,
            ICurrentPrincipalAccessor principalAccessor,
            IServiceProvider serviceProvider)
        {
            Options         = options.Value;
            AuditSerializer = auditSerializer;
            Clock           = clock;
            AuditingStore   = auditingStore;

            Logger             = logger;
            _principalAccessor = principalAccessor;
            ServiceProvider    = serviceProvider;
        }
Example #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void DisableAuditingPage(this AuditingOptions options) => options.SetOption(nameof(IsAuditingPage), false);
Example #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void EnableAuditingPage(this AuditingOptions options) => options.SetOption(nameof(IsAuditingPage), true);
Example #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public static bool IsAuditingPage(this AuditingOptions options) => options.GetOption <bool>(nameof(IsAuditingPage));
Example #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void DisableAuditingController(this AuditingOptions options) => options.SetOption(nameof(IsAuditingController), false);
Example #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void EnableAuditingController(this AuditingOptions options) => options.SetOption(nameof(IsAuditingController), true);
Example #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public static bool IsAuditingController(this AuditingOptions options) => options.GetOption <bool>(nameof(IsAuditingController));
Example #13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public JsonAuditSerializer(IOptions <AuditingOptions> options)
 {
     Options = options.Value;
 }