Files
hcs/Hcs.WebApp/Components/Shared/AuthorizedContent.razor

23 lines
632 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using Microsoft.AspNetCore.Authorization
<AuthorizeView Roles="@Roles">
<Authorized>
<CascadingValue Value="this">
@Content
</CascadingValue>
</Authorized>
<NotAuthorized>
<RadzenAlert AllowClose="false" AlertStyle="AlertStyle.Danger" Variant="Variant.Flat" Shade="Shade.Lighter">
У вас нет прав для доступа к этой странице
</RadzenAlert>
</NotAuthorized>
</AuthorizeView>
@code {
[Parameter]
public required string Roles { get; set; }
[Parameter]
public required RenderFragment Content { get; set; }
}