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 v8.2.0-preview Updated on March 25, 2024, 15:11