Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public void IsAuditingPage()
        {
            var options = new AuditingOptions();

            options.IsAuditingPage().ShouldBeFalse();
            options.EnableAuditingPage();
            options.IsAuditingPage().ShouldBeTrue();
            options.DisableAuditingPage();
            options.IsAuditingPage().ShouldBeFalse();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void DisableAuditingPage(this AuditingOptions options) => options.SetOption(nameof(IsAuditingPage), false);
Ejemplo n.º 8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void EnableAuditingPage(this AuditingOptions options) => options.SetOption(nameof(IsAuditingPage), true);
Ejemplo n.º 9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public static bool IsAuditingPage(this AuditingOptions options) => options.GetOption <bool>(nameof(IsAuditingPage));
Ejemplo n.º 10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void DisableAuditingController(this AuditingOptions options) => options.SetOption(nameof(IsAuditingController), false);
Ejemplo n.º 11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public static void EnableAuditingController(this AuditingOptions options) => options.SetOption(nameof(IsAuditingController), true);
Ejemplo n.º 12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public static bool IsAuditingController(this AuditingOptions options) => options.GetOption <bool>(nameof(IsAuditingController));
Ejemplo n.º 13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public JsonAuditSerializer(IOptions <AuditingOptions> options)
 {
     Options = options.Value;
 }