mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-23 19:42:51 +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; }
|
|
|
|
}
|