Skip to content

Commit

Permalink
Resolved #721: No need to check if auditing is enabled for registerin…
Browse files Browse the repository at this point in the history
…g the interceptor.
  • Loading branch information
hikalkan committed Sep 19, 2016
1 parent b245e54 commit 61aea48
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Abp/Auditing/AuditingInterceptorRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ internal static class AuditingInterceptorRegistrar
public static void Initialize(IIocManager iocManager)
{
var auditingConfiguration = iocManager.Resolve<IAuditingConfiguration>();
if (!auditingConfiguration.IsEnabled)
{
return;
}

iocManager.IocContainer.Kernel.ComponentRegistered += (key, handler) =>
{
if (ShouldIntercept(auditingConfiguration, handler.ComponentModel.Implementation))
Expand All @@ -31,12 +26,12 @@ private static bool ShouldIntercept(IAuditingConfiguration auditingConfiguration
return true;
}

if (type.IsDefined(typeof(AuditedAttribute), true)) //TODO: true or false?
if (type.IsDefined(typeof(AuditedAttribute), true))
{
return true;
}

if (type.GetMethods().Any(m => m.IsDefined(typeof(AuditedAttribute), true))) //TODO: true or false?
if (type.GetMethods().Any(m => m.IsDefined(typeof(AuditedAttribute), true)))
{
return true;
}
Expand Down

0 comments on commit 61aea48

Please sign in to comment.