Open Closed

When Add new module root menu keep showing without login #4731


User avatar
0
fadijb created

When Add new module root menu keep showing without login


  • ABP Framework version: v7.0.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share code of your IMenuContributor

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    fadijb created
       public async Task ConfigureMenuAsync(MenuConfigurationContext context)
        {
            if (context.Menu.Name != StandardMenus.Main)
            {
                return;
            }
    
            var moduleMenu = AddModuleMenuItem(context); //Do not delete `moduleMenu` variable as it will be used by ABP Suite!
    
            AddMenuItemNationalities(context, moduleMenu);
    
            AddMenuItemCountries(context, moduleMenu);
    
            AddMenuItemCities(context, moduleMenu);
        }
    
        private static ApplicationMenuItem AddModuleMenuItem(MenuConfigurationContext context)
        {
            var moduleMenu = new ApplicationMenuItem(
                MainSettingMenus.Prefix,
                context.GetLocalizer<MainSettingResource>()["Menu:MainSetting"],
                "~/MainSetting",
                icon: "fas fa-cogs"
                );
    
            //Add main menu items.
            context.Menu.Items.AddIfNotContains(moduleMenu);
            return moduleMenu;
        }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can check the login status, permissions, features..

    var moduleMenu = new ApplicationMenuItem(
        MainSettingMenus.Prefix,
        context.GetLocalizer<MainSettingResource>()["Menu:MainSetting"],
        "~/MainSetting",
        icon: "fas fa-cogs"
        )
        .RequireAuthenticated()
        .RequirePermissions(CmsKitAdminPermissions.GlobalResources.Default)
        .RequireFeatures()
        .RequireGlobalFeatures();
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    fadijb created
    var moduleMenu = new ApplicationMenuItem(
            MainSettingMenus.Prefix,
            context.GetLocalizer&lt;MainSettingResource&gt;()["Menu:MainSetting"],
            //"~/MainSetting",
            icon: "fas fa-cogs"
            );
            
    

    I just remove this line

    //"~/MainSetting",

    its woking thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.