|
|
|
@ -1,4 +1,4 @@ |
|
|
|
@page "/role-management" |
|
|
|
@page "/identity/role-management" |
|
|
|
@attribute [Authorize] |
|
|
|
@using Volo.Abp.Identity |
|
|
|
@using Microsoft.AspNetCore.Authorization |
|
|
|
@ -15,7 +15,7 @@ |
|
|
|
</Column> |
|
|
|
<Column ColumnSize="ColumnSize.Is6"> |
|
|
|
<Paragraph Alignment="TextAlignment.Right"> |
|
|
|
<Button Color="Color.Primary" Clicked="OpenCreateModal">+ New Role</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="OpenCreateModal">@L["NewRole"]</Button> |
|
|
|
</Paragraph> |
|
|
|
</Column> |
|
|
|
</Row> |
|
|
|
@ -28,31 +28,31 @@ |
|
|
|
ShowPager="true" |
|
|
|
PageSize="@LimitedResultRequestDto.DefaultMaxResultCount"> |
|
|
|
<DataGridColumns> |
|
|
|
<DataGridColumn Width="150px" TItem="IdentityRoleDto" Field="@nameof(IdentityRoleDto.Name)" Sortable="false" Caption="Actions"> |
|
|
|
<DataGridColumn Width="150px" TItem="IdentityRoleDto" Field="@nameof(IdentityRoleDto.Name)" Sortable="false" Caption="@L["Actions"].Value"> |
|
|
|
<DisplayTemplate> |
|
|
|
<Dropdown> |
|
|
|
<DropdownToggle Color="Color.Primary"> |
|
|
|
Actions |
|
|
|
@L["Actions"] |
|
|
|
</DropdownToggle> |
|
|
|
<DropdownMenu> |
|
|
|
<DropdownItem Clicked="() => OpenEditModalAsync(context.As<IdentityRoleDto>().Id)">Edit</DropdownItem> |
|
|
|
<DropdownItem>Manage Permissions</DropdownItem> |
|
|
|
<DropdownItem Clicked="() => OpenEditModalAsync(context.As<IdentityRoleDto>().Id)">@L["Edit"]</DropdownItem> |
|
|
|
<DropdownItem>@L["Permissions"]</DropdownItem> |
|
|
|
<DropdownDivider /> |
|
|
|
<DropdownItem Clicked="() => DeleteRoleAsync(context.As<IdentityRoleDto>())">Delete</DropdownItem> |
|
|
|
<DropdownItem Clicked="() => DeleteRoleAsync(context.As<IdentityRoleDto>())">@L["Delete"]</DropdownItem> |
|
|
|
</DropdownMenu> |
|
|
|
</Dropdown> |
|
|
|
</DisplayTemplate> |
|
|
|
</DataGridColumn> |
|
|
|
<DataGridColumn TItem="IdentityRoleDto" Field="@nameof(IdentityRoleDto.Name)" Caption="Name"> |
|
|
|
<DataGridColumn TItem="IdentityRoleDto" Field="@nameof(IdentityRoleDto.Name)" Caption="@L["RoleName"].Value"> |
|
|
|
<DisplayTemplate> |
|
|
|
@(context.As<IdentityRoleDto>().Name) |
|
|
|
@if (context.As<IdentityRoleDto>().IsDefault) |
|
|
|
{ |
|
|
|
<Badge Color="Color.Primary">default</Badge> |
|
|
|
<Badge Color="Color.Primary">@L["DisplayName:IsDefault"]</Badge> |
|
|
|
} |
|
|
|
@if (context.As<IdentityRoleDto>().IsPublic) |
|
|
|
{ |
|
|
|
<Badge Color="Color.Light">public</Badge> |
|
|
|
<Badge Color="Color.Light">@L["DisplayName:IsPublic"]</Badge> |
|
|
|
} |
|
|
|
</DisplayTemplate> |
|
|
|
</DataGridColumn> |
|
|
|
@ -64,22 +64,22 @@ |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent IsCentered="true"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>Create a new role</ModalTitle> |
|
|
|
<ModalTitle>@L["NewRole"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseCreateModal" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<Field> |
|
|
|
<FieldLabel>Name</FieldLabel> |
|
|
|
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="_newRole.Name" /> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="_newRole.IsDefault">Default</Check> |
|
|
|
<Check TValue="bool" @bind-checked="_newRole.IsPublic">Public</Check> |
|
|
|
<Check TValue="bool" @bind-checked="_newRole.IsDefault">@L["DisplayName:IsDefault"]</Check> |
|
|
|
<Check TValue="bool" @bind-checked="_newRole.IsPublic">@L["DisplayName:IsPublic"]</Check> |
|
|
|
</Field> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModal">Cancel</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="CreateRoleAsync">Save</Button> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModal">@L["Cancel"]</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="CreateRoleAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
@ -95,17 +95,17 @@ |
|
|
|
<ModalBody> |
|
|
|
<input type="hidden" name="ConcurrencyStamp" @bind-value="_editingRole.ConcurrencyStamp" /> |
|
|
|
<Field> |
|
|
|
<FieldLabel>Name</FieldLabel> |
|
|
|
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="_editingRole.Name" /> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="_editingRole.IsDefault">Default</Check> |
|
|
|
<Check TValue="bool" @bind-checked="_editingRole.IsPublic">Public</Check> |
|
|
|
<Check TValue="bool" @bind-checked="_editingRole.IsDefault">@L["DisplayName:IsDefault"]</Check> |
|
|
|
<Check TValue="bool" @bind-checked="_editingRole.IsPublic">@L["DisplayName:IsPublic"]</Check> |
|
|
|
</Field> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditModal">Cancel</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="UpdateRoleAsync">Save</Button> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditModal">@L["Cancel"]</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="UpdateRoleAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |