mirror of https://github.com/abpframework/abp.git
10 changed files with 59 additions and 42 deletions
@ -0,0 +1,15 @@ |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Authorization |
|||
{ |
|||
public static class AuthorizationInterceptorRegistrar |
|||
{ |
|||
public static void RegisterIfNeeded(IOnServiceRegistredContext context) |
|||
{ |
|||
if (typeof(IAuthorizationEnabled).IsAssignableFrom(context.ImplementationType)) |
|||
{ |
|||
context.Interceptors.TryAdd<AuthorizationInterceptor>(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace Volo.Abp.Authorization |
|||
{ |
|||
public interface IAuthorizationEnabled |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
using Volo.Abp.Authorization; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Application.Services |
|||
{ |
|||
public static class AuthorizationInterceptorRegistrar |
|||
{ |
|||
public static void RegisterIfNeeded(IOnServiceRegistredContext context) |
|||
{ |
|||
//TODO Create IAuthorizationEnabled interface and inherit IApplicationService from it!
|
|||
if (typeof(IApplicationService).IsAssignableFrom(context.ImplementationType)) |
|||
{ |
|||
context.Interceptors.TryAdd<AuthorizationInterceptor>(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace Volo.Abp.Application.Services |
|||
{ |
|||
public static class ValidationInterceptorRegistrar |
|||
{ |
|||
public static void RegisterIfNeeded(IOnServiceRegistredContext context) |
|||
{ |
|||
//TODO Create IValidationEnabled interface and inherit IApplicationService from it!
|
|||
if (typeof(IApplicationService).IsAssignableFrom(context.ImplementationType)) |
|||
{ |
|||
context.Interceptors.TryAdd<ValidationInterceptor>(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace Volo.Abp.Application.Services |
|||
{ |
|||
public interface IValidationEnabled |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Validation |
|||
{ |
|||
public static class ValidationInterceptorRegistrar |
|||
{ |
|||
public static void RegisterIfNeeded(IOnServiceRegistredContext context) |
|||
{ |
|||
if (typeof(IValidationEnabled).IsAssignableFrom(context.ImplementationType)) |
|||
{ |
|||
context.Interceptors.TryAdd<ValidationInterceptor>(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue