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.

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

5 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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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?

    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

    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.

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

    [maliming] said: 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.

    HI,

    menu.RequirePermissions(menuItem.RequiredPermissionName); "RequirePermissions" is not found in my application, and I have already mentioned that I am using ABP version 8.3.4.

    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

    hi

    The extension methods exist https://github.com/abpframework/abp/blob/rel-8.3/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionSimpleStateCheckerExtensions.cs#L8-L55

    Can you using Volo.Abp.Authorization.Permissions;?

    Thanks.

    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 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.