Remove redundant roles check
This commit is contained in:
@ -1,17 +1,12 @@
|
|||||||
@using Hcs.WebApp.Services
|
@using Hcs.WebApp.Services
|
||||||
@using Microsoft.AspNetCore.Authorization
|
|
||||||
@using Microsoft.AspNetCore.Identity
|
@using Microsoft.AspNetCore.Identity
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
|
||||||
@attribute [Authorize]
|
|
||||||
|
|
||||||
@inject RoleManager<AppRole> RoleManager
|
@inject RoleManager<AppRole> RoleManager
|
||||||
@inject UsersService UsersService
|
@inject UsersService UsersService
|
||||||
@inject DialogService DialogService
|
@inject DialogService DialogService
|
||||||
|
|
||||||
<AuthorizedContent Roles="@AppRole.ADMINISTRATOR_TYPE">
|
<RadzenTemplateForm TItem="InputModel" Data=@Input Submit="@DoAddUserAsync">
|
||||||
<Content>
|
|
||||||
<RadzenTemplateForm TItem="InputModel" Data=@Input Submit="@DoAddUserAsync">
|
|
||||||
<RadzenAlert Visible="@hasError" AlertStyle="AlertStyle.Danger" Variant="Variant.Flat" Shade="Shade.Lighter" AllowClose="false">
|
<RadzenAlert Visible="@hasError" AlertStyle="AlertStyle.Danger" Variant="Variant.Flat" Shade="Shade.Lighter" AllowClose="false">
|
||||||
@errorMessage
|
@errorMessage
|
||||||
</RadzenAlert>
|
</RadzenAlert>
|
||||||
@ -55,9 +50,7 @@
|
|||||||
<RadzenButton Click="@DoClose" ButtonStyle="ButtonStyle.Light" Disabled="@inProgress" Text="Отмена"></RadzenButton>
|
<RadzenButton Click="@DoClose" ButtonStyle="ButtonStyle.Light" Disabled="@inProgress" Text="Отмена"></RadzenButton>
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
</RadzenTemplateForm>
|
</RadzenTemplateForm>
|
||||||
</Content>
|
|
||||||
</AuthorizedContent>
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
sealed class InputModel
|
sealed class InputModel
|
||||||
|
|||||||
@ -1,18 +1,13 @@
|
|||||||
@using Hcs.WebApp.Services
|
@using Hcs.WebApp.Services
|
||||||
@using Microsoft.AspNetCore.Authorization
|
|
||||||
@using Microsoft.AspNetCore.Identity
|
@using Microsoft.AspNetCore.Identity
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
|
||||||
@attribute [Authorize]
|
|
||||||
|
|
||||||
@inject UserManager<AppUser> UserManager;
|
@inject UserManager<AppUser> UserManager;
|
||||||
@inject RoleManager<AppRole> RoleManager
|
@inject RoleManager<AppRole> RoleManager
|
||||||
@inject UsersService UsersService
|
@inject UsersService UsersService
|
||||||
@inject DialogService DialogService
|
@inject DialogService DialogService
|
||||||
|
|
||||||
<AuthorizedContent Roles="@AppRole.ADMINISTRATOR_TYPE">
|
<RadzenTemplateForm TItem="InputModel" Data=@Input Submit="@DoEditUserAsync">
|
||||||
<Content>
|
|
||||||
<RadzenTemplateForm TItem="InputModel" Data=@Input Submit="@DoEditUserAsync">
|
|
||||||
<RadzenAlert Visible="@hasError" AlertStyle="AlertStyle.Danger" Variant="Variant.Flat" Shade="Shade.Lighter" AllowClose="false">
|
<RadzenAlert Visible="@hasError" AlertStyle="AlertStyle.Danger" Variant="Variant.Flat" Shade="Shade.Lighter" AllowClose="false">
|
||||||
@errorMessage
|
@errorMessage
|
||||||
</RadzenAlert>
|
</RadzenAlert>
|
||||||
@ -52,9 +47,7 @@
|
|||||||
<RadzenButton Click="@DoClose" ButtonStyle="ButtonStyle.Light" Disabled="@inProgress" Text="Отмена"></RadzenButton>
|
<RadzenButton Click="@DoClose" ButtonStyle="ButtonStyle.Light" Disabled="@inProgress" Text="Отмена"></RadzenButton>
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
</RadzenTemplateForm>
|
</RadzenTemplateForm>
|
||||||
</Content>
|
|
||||||
</AuthorizedContent>
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
sealed class InputModel
|
sealed class InputModel
|
||||||
|
|||||||
Reference in New Issue
Block a user