diff --git a/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs b/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs index aa19c588..5154ba22 100644 --- a/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs +++ b/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs @@ -1,6 +1,5 @@ using Bootstrap.Security.Blazor; using BootstrapAdmin.DataAccess.Models; -using Microsoft.AspNetCore.Components.Authorization; namespace BootstrapAdmin.Web.Core.Services; @@ -66,7 +65,7 @@ public class AdminService : IBootstrapAdminService var menu = menus.FirstOrDefault(m => m.Url.Contains(url, StringComparison.OrdinalIgnoreCase)); if (menu != null) { - ret = menus.FirstOrDefault(m => m.ParentId == menu.Id && m.IsResource == EnumResource.Block && m.Url.Equals(blockName, StringComparison.OrdinalIgnoreCase)) != null; + ret = menus.Any(m => m.ParentId == menu.Id && m.IsResource == EnumResource.Block && m.Url.Equals(blockName, StringComparison.OrdinalIgnoreCase)); } } return ret;