diff --git a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor index a7aefadc..0682ea0d 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor @@ -1,4 +1,4 @@ - + @HeaderText diff --git a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor.cs index e1fe28cb..1f6cedcd 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminCard.razor.cs @@ -1,4 +1,7 @@ -namespace BootstrapAdmin.Web.Components +using BootstrapAdmin.Web.Core; +using BootstrapAdmin.Web.Services; + +namespace BootstrapAdmin.Web.Components { /// /// @@ -24,5 +27,24 @@ /// [Parameter] public RenderFragment? ChildContent { get; set; } + + [Inject] + [NotNull] + private INavigation? NavigationService { get; set; } + + [Inject] + [NotNull] + private BootstrapAppContext? AppContext { get; set; } + + [Inject] + [NotNull] + private NavigationManager? NavigationManager { get; set; } + + private Task OnQueryCondition(string name) + { + var url = NavigationManager.ToBaseRelativePath(NavigationManager.Uri); + + return Task.FromResult(NavigationService.AuthorizationBlock(AppContext.UserName, url, name)); + } } }