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:
-
CMS menus should not be visible for anonymous users. -
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:
-
Hide CMS menus for anonymous users? -
Show them only after login? -
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)
-
0
hi
We added a
requiredPermissionNameto the menu after 9.1https://github.com/abpframework/abp/pull/21733
Thanks.
-
0
[maliming] said: hi
We added a
requiredPermissionNameto the menu after 9.1https://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?
-
0
hi
You can replace the
CmsKitPublicMenuContributorand 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.