Starts in:
0 DAY
12 HRS
12 MIN
49 SEC
Starts in:
0 D
12 H
12 M
49 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