|
|
|
@ -1,5 +1,5 @@ |
|
|
|
@page "/identity/roles" |
|
|
|
@attribute [Authorize( IdentityPermissions.Roles.Default )] |
|
|
|
@attribute [Authorize(IdentityPermissions.Roles.Default)] |
|
|
|
@using Volo.Abp.Identity |
|
|
|
@using Microsoft.AspNetCore.Authorization |
|
|
|
@using Microsoft.AspNetCore.Components.Forms |
|
|
|
@ -16,7 +16,7 @@ |
|
|
|
<Heading Size="HeadingSize.Is1">@L["Roles"]</Heading> |
|
|
|
</Column> |
|
|
|
<Column ColumnSize="ColumnSize.Is6"> |
|
|
|
@if ( HasCreatePermission ) |
|
|
|
@if (HasCreatePermission) |
|
|
|
{ |
|
|
|
<Paragraph Alignment="TextAlignment.Right"> |
|
|
|
<Button Color="Color.Primary" Clicked="OpenCreateModalAsync">@L["NewRole"]</Button> |
|
|
|
@ -33,40 +33,33 @@ |
|
|
|
ShowPager="true" |
|
|
|
PageSize="PageSize"> |
|
|
|
<DataGridColumns> |
|
|
|
@if ( ShouldShowEntityActions ) |
|
|
|
{ |
|
|
|
<DataGridColumn Width="150px" TItem="IdentityRoleDto" Field="@nameof(IdentityRoleDto.Name)" Sortable="false" Caption="@L["Actions"].Value"> |
|
|
|
<DisplayTemplate> |
|
|
|
<Dropdown> |
|
|
|
<DropdownToggle Color="Color.Primary"> |
|
|
|
@L["Actions"] |
|
|
|
</DropdownToggle> |
|
|
|
<DropdownMenu> |
|
|
|
@if ( HasUpdatePermission ) |
|
|
|
{ |
|
|
|
<DropdownItem Clicked="() => OpenEditModalAsync(context.As<IdentityRoleDto>().Id)">@L["Edit"]</DropdownItem> |
|
|
|
} |
|
|
|
@if ( HasManagePermissionsPermission ) |
|
|
|
{ |
|
|
|
<DropdownItem Clicked="() => PermissionManagementModal.OpenAsync(PermissionProviderName, context.As<IdentityRoleDto>().Name)">@L["Permissions"]</DropdownItem> |
|
|
|
} |
|
|
|
@if ( HasDeletePermission ) |
|
|
|
{ |
|
|
|
<DropdownItem Clicked="() => DeleteEntityAsync(context.As<IdentityRoleDto>())">@L["Delete"]</DropdownItem> |
|
|
|
} |
|
|
|
</DropdownMenu> |
|
|
|
</Dropdown> |
|
|
|
</DisplayTemplate> |
|
|
|
</DataGridColumn> |
|
|
|
} |
|
|
|
<DataGridEntityActionsColumn TItem="IdentityRoleDto" @ref="@EntityActionsColumn"> |
|
|
|
<DisplayTemplate> |
|
|
|
<EntityActions TItem="IdentityRoleDto" EntityActionsColumn="@EntityActionsColumn"> |
|
|
|
<EntityAction TItem="IdentityRoleDto" |
|
|
|
RequiredPolicy="@UpdatePolicyName" |
|
|
|
Clicked="() => OpenEditModalAsync(context.Id)" |
|
|
|
Text="@L["Edit"]"></EntityAction> |
|
|
|
<EntityAction TItem="IdentityRoleDto" |
|
|
|
RequiredPolicy="@ManagePermissionsPolicyName" |
|
|
|
Clicked="() => PermissionManagementModal.OpenAsync(PermissionProviderName, context.Name)" |
|
|
|
Text="@L["Permissions"]"></EntityAction> |
|
|
|
<EntityAction TItem="IdentityRoleDto" |
|
|
|
RequiredPolicy="@DeletePolicyName" |
|
|
|
Clicked="() => DeleteEntityAsync(context)" |
|
|
|
ConfirmationMessage="()=> GetDeleteConfirmationMessage(context)" |
|
|
|
Text="@L["Delete"]"></EntityAction> |
|
|
|
</EntityActions> |
|
|
|
</DisplayTemplate> |
|
|
|
</DataGridEntityActionsColumn> |
|
|
|
<DataGridColumn TItem="IdentityRoleDto" Field="@nameof(IdentityRoleDto.Name)" Caption="@L["RoleName"].Value"> |
|
|
|
<DisplayTemplate> |
|
|
|
@(context.As<IdentityRoleDto>().Name) |
|
|
|
@if ( context.As<IdentityRoleDto>().IsDefault ) |
|
|
|
@(context.Name) |
|
|
|
@if (context.IsDefault) |
|
|
|
{ |
|
|
|
<Badge Color="Color.Primary">@L["DisplayName:IsDefault"]</Badge> |
|
|
|
} |
|
|
|
@if ( context.As<IdentityRoleDto>().IsPublic ) |
|
|
|
@if (context.IsPublic) |
|
|
|
{ |
|
|
|
<Badge Color="Color.Light">@L["DisplayName:IsPublic"]</Badge> |
|
|
|
} |
|
|
|
@ -76,42 +69,42 @@ |
|
|
|
</DataGrid> |
|
|
|
|
|
|
|
@* ************************* CREATE MODAL ************************* *@ |
|
|
|
@if ( HasCreatePermission ) |
|
|
|
@if (HasCreatePermission) |
|
|
|
{ |
|
|
|
<Modal @ref="CreateModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent Centered="true"> |
|
|
|
<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"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Modal @ref="CreateModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent Centered="true"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["NewRole"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseCreateModalAsync" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<Validations @ref="@CreateValidationsRef" Model="@NewEntity" ValidateOnLoad="false"> |
|
|
|
<Validation MessageLocalizer="@LH.Localize"> |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-Checked="@NewEntity.IsDefault">@L["DisplayName:IsDefault"]</Check> |
|
|
|
<Check TValue="bool" @bind-Checked="@NewEntity.IsPublic">@L["DisplayName:IsPublic"]</Check> |
|
|
|
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="@NewEntity.Name"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validations> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModalAsync">@L["Cancel"]</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
</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> |
|
|
|
<Button Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
} |
|
|
|
@* ************************* EDIT MODAL ************************* *@ |
|
|
|
@if ( HasUpdatePermission ) |
|
|
|
@if (HasUpdatePermission) |
|
|
|
{ |
|
|
|
<Modal @ref="EditModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
|