- ABP Framework version: v5.1.3
- UI type: Blazor WebAssembly
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes / no
I need hide or show Main Menú Items from Abp Modules.
For example I need hide FileManagement from main menu based on roles or permissions, don't matter if I added permissions inside application I need always hide menu based in other permission. This not found:
var fileMenu = context.Menu.FindMenuItem(FileManagementMenuNames.GroupName);
fileMenu.RequirePermissions("MyProject.Crm.Shared");
Thank you.
12 Answer(s)
-
0
hi
Are you enable the
FileManagementFeatures.Enable
?await featureChecker.IsEnabledAsync(FileManagementFeatures.Enable)
-
0
Thank you maliming, sorry but I don't know where can I put this sentence, is in menu class?
-
0
-
0
-
0
hi
Can you create a template project to reproduce and share it with me? liming.ma@volosoft.com
-
0
Sure I send you a email.
Thank you,
-
0
-
0
Hello maliming,
I granted you more access to project please try again.
Thank you,
-
0
-
0
Hello,
I already send you the project through email.
Thank you,
-
0
hi
You can add these code to the
SportsMenuContributor
I will fix the menu problem in next version.var lf = context.GetLocalizer<FileManagementResource>(); context.Menu.GetAdministration().TryRemoveMenuItem(FileManagementMenuNames.GroupName); context.Menu .GetAdministration() .AddItem( new ApplicationMenuItem(FileManagementMenuNames.GroupName, lf["Menu:FileManagement"], "~/file-management", icon: "fa fa-folder-open") .RequireFeatures(FileManagementFeatures.Enable) .RequirePermissions(FileManagementPermissions.DirectoryDescriptor.Default) .RequirePermissions("Innovain.Sports.Shared") );
-
0
Hi,
With little changes, this found.
Thank you maliming.