Ends in:
7 DAYS
11 HRS
14 MIN
22 SEC
Ends in:
7 D
11 H
14 M
22 S
Open Closed

Menu is not hiding while checking permission on menucontributor class #2810


User avatar
0
safi created

Hi

I need to hide one menu for admin only so I have added a permission check after login that menu is coming but when we reload or refresh page that time it's hiding that menu. Could you please provide me solution for this.

I tried below code but no luck.

 ICurrentUser currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>();

            bool IsAdmin = currentUser.IsInRole("admin");
 if (!IsAdmin)
                     {
          //menu code

            }
  • ABP Framework version: v4.4.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

No answer yet!
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06