diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetPolicyChecker.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetManager.cs similarity index 54% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetPolicyChecker.cs rename to framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetManager.cs index 14819477f1..6256878605 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetPolicyChecker.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetManager.cs @@ -6,10 +6,10 @@ using Volo.Abp.DependencyInjection; namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets { - public interface IWidgetPolicyChecker : ITransientDependency + public interface IWidgetManager : ITransientDependency { - Task CheckAsync(Type widgetComponentType); + Task IsGrantedAsync(Type widgetComponentType); - Task CheckAsync(string name); + Task IsGrantedAsync(string name); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetPolicyChecker.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs similarity index 76% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetPolicyChecker.cs rename to framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs index 742e361a2d..54bd8cb274 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetPolicyChecker.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetManager.cs @@ -7,13 +7,13 @@ using Volo.Abp.Users; namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets { - public class WidgetPolicyChecker : IWidgetPolicyChecker + public class WidgetManager : IWidgetManager { protected WidgetOptions Options { get; } protected IAuthorizationService AuthorizationService { get; } protected ICurrentUser CurrentUser { get; } - public WidgetPolicyChecker( + public WidgetManager( IOptions widgetOptions, IAuthorizationService authorizationService, ICurrentUser currentUser) @@ -23,21 +23,21 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets Options = widgetOptions.Value; } - public async Task CheckAsync(Type widgetComponentType) + public async Task IsGrantedAsync(Type widgetComponentType) { var widget = Options.Widgets.Find(widgetComponentType); - return await CheckAsyncInternal(widget, widgetComponentType.FullName); + return await IsGrantedAsyncInternal(widget, widgetComponentType.FullName); } - public async Task CheckAsync(string name) + public async Task IsGrantedAsync(string name) { var widget = Options.Widgets.Find(name); - return await CheckAsyncInternal(widget, name); + return await IsGrantedAsyncInternal(widget, name); } - private async Task CheckAsyncInternal(WidgetDefinition widget, string wantedWidgetName) + private async Task IsGrantedAsyncInternal(WidgetDefinition widget, string wantedWidgetName) { if (widget == null) {