mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
5.4 KiB
115 lines
5.4 KiB
@page "/identity/roles"
|
|
@attribute [Authorize(IdentityPermissions.Roles.Default)]
|
|
@using Volo.Abp.Identity
|
|
@using Microsoft.AspNetCore.Authorization
|
|
@using Volo.Abp.PermissionManagement.Blazor.Components
|
|
@using Volo.Abp.Identity.Localization
|
|
@using Volo.Abp.AspNetCore.Components.Web
|
|
@using Volo.Abp.AspNetCore.Components.Web.Theming
|
|
@using Volo.Abp.BlazoriseUI.Components.ObjectExtending
|
|
@using Volo.Abp.AspNetCore.Components.Web.Theming.Layout
|
|
@inject AbpBlazorMessageLocalizerHelper<IdentityResource> LH
|
|
|
|
@inherits AbpCrudPageBase<IIdentityRoleAppService, IdentityRoleDto, Guid, GetIdentityRolesInput, IdentityRoleCreateDto, IdentityRoleUpdateDto>
|
|
<Card>
|
|
<CardHeader>
|
|
@* ************************* PAGE HEADER ************************* *@
|
|
<PageHeader Title="@L["Roles"]"
|
|
BreadcrumbItems="@BreadcrumbItems"
|
|
Toolbar="@Toolbar">
|
|
</PageHeader>
|
|
</CardHeader>
|
|
<CardBody>
|
|
@* ************************* DATA GRID ************************* *@
|
|
<AbpExtensibleDataGrid TItem="IdentityRoleDto"
|
|
Data="@Entities"
|
|
ReadData="@OnDataGridReadAsync"
|
|
TotalItems="@TotalCount"
|
|
ShowPager="true"
|
|
PageSize="@PageSize"
|
|
CurrentPage="@CurrentPage"
|
|
Columns="@RoleManagementTableColumns">
|
|
</AbpExtensibleDataGrid>
|
|
</CardBody>
|
|
</Card>
|
|
|
|
@* ************************* CREATE MODAL ************************* *@
|
|
@if (HasCreatePermission)
|
|
{
|
|
<Modal @ref="CreateModal" Closing="@ClosingCreateModal">
|
|
<ModalContent Centered="true">
|
|
<Form>
|
|
<ModalHeader>
|
|
<ModalTitle>@L["NewRole"]</ModalTitle>
|
|
<CloseButton Clicked="CloseCreateModalAsync"/>
|
|
</ModalHeader>
|
|
<ModalBody>
|
|
<Validations @ref="@CreateValidationsRef" Model="@NewEntity" ValidateOnLoad="false">
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel>
|
|
<TextEdit @bind-Text="@NewEntity.Name" Autofocus="true">
|
|
<Feedback>
|
|
<ValidationError/>
|
|
</Feedback>
|
|
</TextEdit>
|
|
</Field>
|
|
<ExtensionProperties TEntityType="IdentityRoleCreateDto" TResourceType="IdentityResource" Entity="@NewEntity" LH="@LH"/>
|
|
</Validation>
|
|
<Field>
|
|
<Check TValue="bool" @bind-Checked="@NewEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
|
|
<Check TValue="bool" @bind-Checked="@NewEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
|
|
</Field>
|
|
</Validations>
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModalAsync">@L["Cancel"]</Button>
|
|
<SubmitButton Clicked="@CreateEntityAsync"/>
|
|
</ModalFooter>
|
|
</Form>
|
|
</ModalContent>
|
|
</Modal>
|
|
}
|
|
@* ************************* EDIT MODAL ************************* *@
|
|
@if (HasUpdatePermission)
|
|
{
|
|
<Modal @ref="EditModal" Closing="@ClosingEditModal">
|
|
<ModalContent Centered="true">
|
|
<Form>
|
|
<ModalHeader>
|
|
<ModalTitle>@L["Edit"]</ModalTitle>
|
|
<CloseButton Clicked="CloseEditModalAsync"/>
|
|
</ModalHeader>
|
|
<ModalBody>
|
|
<Validations @ref="@EditValidationsRef" Model="@EditingEntity" ValidateOnLoad="false">
|
|
<input type="hidden" name="ConcurrencyStamp" @bind-value="EditingEntity.ConcurrencyStamp"/>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel>
|
|
<TextEdit @bind-Text="EditingEntity.Name" Autofocus="true">
|
|
<Feedback>
|
|
<ValidationError/>
|
|
</Feedback>
|
|
</TextEdit>
|
|
</Field>
|
|
<ExtensionProperties TEntityType="IdentityRoleUpdateDto" TResourceType="IdentityResource" Entity="@EditingEntity" LH="@LH"/>
|
|
</Validation>
|
|
<Field>
|
|
<Check TValue="bool" @bind-Checked="@EditingEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
|
|
<Check TValue="bool" @bind-Checked="@EditingEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
|
|
</Field>
|
|
</Validations>
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<Button Color="Color.Secondary" Clicked="CloseEditModalAsync">@L["Cancel"]</Button>
|
|
<SubmitButton Clicked="@UpdateEntityAsync"/>
|
|
</ModalFooter>
|
|
</Form>
|
|
</ModalContent>
|
|
</Modal>
|
|
}
|
|
|
|
@if (HasManagePermissionsPermission)
|
|
{
|
|
<PermissionManagementModal @ref="PermissionManagementModal"/>
|
|
}
|