Open Closed

Modify ToolBar Items from "Main" #5979


User avatar
0
WilliamT created
  • ABP Framework version: v7.1.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi,

How Can I remove these 4 items from "Main" Toolbar:

  • Linked Accounts
  • Authority delegation
  • security logs
  • Personal data

Is there a way to control those items via permission?

Regards,

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Member

    Hello WilliamT,

    Please add this code to CustomMenuContributor under *.Web/Menus

    public async Task ConfigureMenuAsync(MenuConfigurationContext context)
        {
            if (context.Menu.Name == StandardMenus.User)
            {
                context.Menu.Items.RemoveAll(x => x.Name == "Account.SecurityLogs");
                context.Menu.Items.RemoveAll(x => x.Name == "Account.LinkedAccounts");
                context.Menu.Items.RemoveAll(x => x.Name == "Account.AuthorityDelegation");
            }
        }
    

    It will gives output like

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    WilliamT created

    Hi Anjali,

    Thank you. However, is there a cleaner approach? Such as creating a new StandardMenu config where I can define what items it will have?

    Regards,

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Member

    Hello WilliamT,

    please try to add the below code to add new menu item

    context.Menu.AddItem(
                   new ApplicationMenuItem(demo5979Menus.Home,"My New Menu Item", "/My/NewMenuItem", icon: "fa fa-home"));
    
    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 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.