Browse Source
Merge pull request #5908 from abpframework/maliming/role-filter
Add Filter parameter to GetListAsync method of IIdentityRoleAppService.
pull/5924/head
Halil İbrahim Kalkan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
18 additions and
10 deletions
-
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs
-
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs
-
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs
-
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs
-
modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
-
modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs
|
|
|
@ -0,0 +1,9 @@ |
|
|
|
using Volo.Abp.Application.Dtos; |
|
|
|
|
|
|
|
namespace Volo.Abp.Identity |
|
|
|
{ |
|
|
|
public class GetIdentityRolesInput : PagedAndSortedResultRequestDto |
|
|
|
{ |
|
|
|
public string Filter { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
@ -9,7 +9,7 @@ namespace Volo.Abp.Identity |
|
|
|
: ICrudAppService< |
|
|
|
IdentityRoleDto, |
|
|
|
Guid, |
|
|
|
PagedAndSortedResultRequestDto, |
|
|
|
GetIdentityRolesInput, |
|
|
|
IdentityRoleCreateDto, |
|
|
|
IdentityRoleUpdateDto> |
|
|
|
{ |
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
@ -37,9 +37,9 @@ namespace Volo.Abp.Identity |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetListAsync(PagedAndSortedResultRequestDto input) |
|
|
|
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetListAsync(GetIdentityRolesInput input) |
|
|
|
{ |
|
|
|
var list = await RoleRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount); |
|
|
|
var list = await RoleRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter); |
|
|
|
var totalCount = await RoleRepository.GetCountAsync(); |
|
|
|
|
|
|
|
return new PagedResultDto<IdentityRoleDto>( |
|
|
|
@ -57,7 +57,7 @@ namespace Volo.Abp.Identity |
|
|
|
CurrentTenant.Id |
|
|
|
) |
|
|
|
{ |
|
|
|
IsDefault = input.IsDefault, |
|
|
|
IsDefault = input.IsDefault, |
|
|
|
IsPublic = input.IsPublic |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
@ -1,13 +1,12 @@ |
|
|
|
using System; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Volo.Abp.Application.Dtos; |
|
|
|
using Volo.Abp.BlazoriseUI; |
|
|
|
using Volo.Abp.PermissionManagement.Blazor.Components; |
|
|
|
|
|
|
|
namespace Volo.Abp.Identity.Blazor.Pages.Identity |
|
|
|
{ |
|
|
|
public abstract class RoleManagementBase : AbpCrudPageBase<IIdentityRoleAppService,IdentityRoleDto, Guid, PagedAndSortedResultRequestDto, IdentityRoleCreateDto, IdentityRoleUpdateDto> |
|
|
|
public abstract class RoleManagementBase : AbpCrudPageBase<IIdentityRoleAppService, IdentityRoleDto, Guid, GetIdentityRolesInput, IdentityRoleCreateDto, IdentityRoleUpdateDto> |
|
|
|
{ |
|
|
|
protected const string PermissionProviderName = "R"; |
|
|
|
|
|
|
|
|
|
|
|
@ -27,7 +27,7 @@ namespace Volo.Abp.Identity |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public virtual Task<PagedResultDto<IdentityRoleDto>> GetListAsync(PagedAndSortedResultRequestDto input) |
|
|
|
public virtual Task<PagedResultDto<IdentityRoleDto>> GetListAsync(GetIdentityRolesInput input) |
|
|
|
{ |
|
|
|
return RoleAppService.GetListAsync(input); |
|
|
|
} |
|
|
|
|
|
|
|
@ -45,13 +45,13 @@ namespace Volo.Abp.Identity |
|
|
|
|
|
|
|
result.Items.Count.ShouldBeGreaterThan(0); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task GetListAsync() |
|
|
|
{ |
|
|
|
//Act
|
|
|
|
|
|
|
|
var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); |
|
|
|
var result = await _roleAppService.GetListAsync(new GetIdentityRolesInput()); |
|
|
|
|
|
|
|
//Assert
|
|
|
|
|
|
|
|
|