From 0b74af6f900ba78b1635fbac98364e8ea3c37b6a Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 21 Feb 2020 12:08:27 +0800 Subject: [PATCH] introduce AlwaysAllowMethodInvocationAuthorizationService. Resolve #2874 --- .../AbpAuthorizationServiceCollectionExtensions.cs | 1 + ...lwaysAllowMethodInvocationAuthorizationService.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AlwaysAllowMethodInvocationAuthorizationService.cs diff --git a/framework/src/Volo.Abp.Authorization/Microsoft/Extensions/DependencyInjection/AbpAuthorizationServiceCollectionExtensions.cs b/framework/src/Volo.Abp.Authorization/Microsoft/Extensions/DependencyInjection/AbpAuthorizationServiceCollectionExtensions.cs index 093c9f3884..1cd3f5a0b7 100644 --- a/framework/src/Volo.Abp.Authorization/Microsoft/Extensions/DependencyInjection/AbpAuthorizationServiceCollectionExtensions.cs +++ b/framework/src/Volo.Abp.Authorization/Microsoft/Extensions/DependencyInjection/AbpAuthorizationServiceCollectionExtensions.cs @@ -11,6 +11,7 @@ namespace Microsoft.Extensions.DependencyInjection { services.Replace(ServiceDescriptor.Singleton()); services.Replace(ServiceDescriptor.Singleton()); + services.Replace(ServiceDescriptor.Singleton()); return services.Replace(ServiceDescriptor.Singleton()); } } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AlwaysAllowMethodInvocationAuthorizationService.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AlwaysAllowMethodInvocationAuthorizationService.cs new file mode 100644 index 0000000000..d4a30b56f5 --- /dev/null +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AlwaysAllowMethodInvocationAuthorizationService.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.Authorization +{ + public class AlwaysAllowMethodInvocationAuthorizationService : IMethodInvocationAuthorizationService + { + public Task CheckAsync(MethodInvocationAuthorizationContext context) + { + return Task.CompletedTask; + } + } +} \ No newline at end of file