Remove redundant roles check

This commit is contained in:
2025-11-05 09:05:25 +09:00
parent a063ef40a5
commit 35c4bb37ce
2 changed files with 86 additions and 100 deletions

View File

@ -1,16 +1,11 @@
@using Hcs.WebApp.Services
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Identity
@using Microsoft.EntityFrameworkCore
@attribute [Authorize]
@inject RoleManager<AppRole> RoleManager
@inject UsersService UsersService
@inject DialogService DialogService
<AuthorizedContent Roles="@AppRole.ADMINISTRATOR_TYPE">
<Content>
<RadzenTemplateForm TItem="InputModel" Data=@Input Submit="@DoAddUserAsync">
<RadzenAlert Visible="@hasError" AlertStyle="AlertStyle.Danger" Variant="Variant.Flat" Shade="Shade.Lighter" AllowClose="false">
@errorMessage
@ -56,8 +51,6 @@
</RadzenStack>
</RadzenStack>
</RadzenTemplateForm>
</Content>
</AuthorizedContent>
@code {
sealed class InputModel

View File

@ -1,17 +1,12 @@
@using Hcs.WebApp.Services
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Identity
@using Microsoft.EntityFrameworkCore
@attribute [Authorize]
@inject UserManager<AppUser> UserManager;
@inject RoleManager<AppRole> RoleManager
@inject UsersService UsersService
@inject DialogService DialogService
<AuthorizedContent Roles="@AppRole.ADMINISTRATOR_TYPE">
<Content>
<RadzenTemplateForm TItem="InputModel" Data=@Input Submit="@DoEditUserAsync">
<RadzenAlert Visible="@hasError" AlertStyle="AlertStyle.Danger" Variant="Variant.Flat" Shade="Shade.Lighter" AllowClose="false">
@errorMessage
@ -53,8 +48,6 @@
</RadzenStack>
</RadzenStack>
</RadzenTemplateForm>
</Content>
</AuthorizedContent>
@code {
sealed class InputModel