Open Closed

Menu won't add new items #757


User avatar
0
Gary created

Generating a new entity with suite 4.02 works OK. However the entry added to the menu in EducatePlusMenuContributor.cs fails to show on the menu itself. I have worked at rearranging the entries, changing the order numbers, Clean and rebuild the project, but fail to get a new menu to show.

I suspect if (await context.IsGrantedAsync(EducatePlusPermissions.TestForMenus.Default)) if not returning true, what can I add to the else statement to get an error message. All entities are the same multitenanted.

Example menu items

 if (await authorizationService.IsGrantedAsync(EducatePlusPermissions.Dashboard.Tenant))
            {
                //TenantDashboard
                context.Menu.AddItem(
                    new ApplicationMenuItem(
                        EducatePlusMenus.TenantDashboard,
                        l["Menu:Dashboard"],
                        "/Dashboard",
                        icon: "fa fa-line-chart",
                        order: 4
                    )
                );
            }
            if (await context.IsGrantedAsync(EducatePlusPermissions.Ethnicities.Default))
            {
                context.Menu.AddItem(
                    new ApplicationMenuItem(
                        "EducatePlus.Ethnicities",
                        l["Menu:Ethnicities"],
                        url: "/Ethnicities",
                        icon: "fa fa-file-alt",
                         order: 12)
                );
            }

this one won't show,

            if (await context.IsGrantedAsync(EducatePlusPermissions.TestForMenus.Default))
            {
                context.Menu.AddItem(
                    new ApplicationMenuItem(
                        "EducatePlus.TestForMenus",
                        l["Menu:TestForMenus"],
                        url: "/TestForMenus",
                        icon: "fa fa-file-alt",
                         order: 13)
                );
            }

Actual output


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

    await context.IsGrantedAsync(EducatePlusPermissions.TestForMenus.Default)

    Maybe the current user does not have EducatePlusPermissions.TestForMenus.Default permission

  • User Avatar
    0
    Gary created

    Hi there, sorry for the delay I have been on holiday.

    All the permissions are there, I just cann't add any more menus.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Can I check it remotely?(UTC+8) shiwei.liang@volosoft.com

  • User Avatar
    0
    Gary created

    Solved it!! It was different version numbers between suite and Dependancies. All set to 4.1.1 and it works.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13