mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-25 07:42:58 +01:00
21 lines
492 B
Plaintext
21 lines
492 B
Plaintext
@using Microsoft.AspNetCore.Components.Authorization
|
|
@using Phantom.Common.Data.Web.Users
|
|
@using Phantom.Web.Services.Authentication
|
|
<AuthorizeView>
|
|
<Authorized>
|
|
@if (ChildContent != null && context.CheckPermission(Permission)) {
|
|
@ChildContent(context)
|
|
}
|
|
</Authorized>
|
|
</AuthorizeView>
|
|
|
|
@code {
|
|
|
|
[Parameter, EditorRequired]
|
|
public Permission Permission { get; set; } = null!;
|
|
|
|
[Parameter]
|
|
public RenderFragment<AuthenticationState>? ChildContent { get; set; }
|
|
|
|
}
|