Starts in:
2 DAYS
16 HRS
56 MIN
49 SEC
Starts in:
2 D
16 H
56 M
49 S
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.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06