Merge pull request #17867 from abpframework/liangshiwei/cms-fix

Check MenuEnable feature in the CmsKitPublicMenuContributor
pull/17874/head
Enis Necipoglu 1 year ago committed by GitHub
commit b61e1955dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,8 +2,10 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Features;
using Volo.Abp.GlobalFeatures;
using Volo.Abp.UI.Navigation;
using Volo.CmsKit.Features;
using Volo.CmsKit.GlobalFeatures;
using Volo.CmsKit.Menus;
using Volo.CmsKit.Public.Menus;
@ -22,7 +24,8 @@ public class CmsKitPublicMenuContributor : IMenuContributor
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
if (GlobalFeatureManager.Instance.IsEnabled<MenuFeature>())
var featureChecker = context.ServiceProvider.GetRequiredService<IFeatureChecker>();
if (GlobalFeatureManager.Instance.IsEnabled<MenuFeature>() && await featureChecker.IsEnabledAsync(CmsKitFeatures.MenuEnable))
{
var menuAppService = context.ServiceProvider.GetRequiredService<IMenuItemPublicAppService>();

Loading…
Cancel
Save