Open Closed

How to hide(Control) CMS Kit menus for anonymous users and show only after login? #10323


User avatar
0
Vipinthachinari created

Hi,

I am facing an issue while suing Cms Menu.

When I create a page from CMS Kit, it automatically appears in the main menu and is visible even without login. My requirements are:

  1. CMS menus should not be visible for anonymous users.
    
  2. They should be shown only after the user logs in.
    

Additionally, I want to dynamically control hide/show of CMS menus from Settings or by code.

Questions:

How can I control the visibility of CMS menus? Is there any built-in setting or recommended way to:

  1. Hide CMS menus for anonymous users?
    
  2. Show them only after login?
    
  3. Dynamically control their visibility?
    

Currently, CMS menus are always visible and I couldn’t find any option in CMS Page settings to control this.


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

    hi

    We added a requiredPermissionName to the menu after 9.1

    https://github.com/abpframework/abp/pull/21733

    Thanks.

  • User Avatar
    0
    Vipinthachinari created

    [maliming] said: hi

    We added a requiredPermissionName to the menu after 9.1

    https://github.com/abpframework/abp/pull/21733

    Thanks.

    Hi,

    Thank you for your support. Currently, I am using ABP version 8.3.4. Is there any method available in this version?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can replace the CmsKitPublicMenuContributor and check the permissions of your menus.

    eg menu.RequireAuthenticated()

    https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs#L27-L44

    Thanks.

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.2.0-preview. Updated on January 20, 2026, 07:04
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.