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
parent
commit
a5b2d501a1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs
  2. 2
      modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs
  3. 8
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs
  4. 3
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs
  5. 2
      modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
  6. 4
      modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs

9
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs

@ -0,0 +1,9 @@
using Volo.Abp.Application.Dtos;
namespace Volo.Abp.Identity
{
public class GetIdentityRolesInput : PagedAndSortedResultRequestDto
{
public string Filter { get; set; }
}
}

2
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.Identity
: ICrudAppService< : ICrudAppService<
IdentityRoleDto, IdentityRoleDto,
Guid, Guid,
PagedAndSortedResultRequestDto, GetIdentityRolesInput,
IdentityRoleCreateDto, IdentityRoleCreateDto,
IdentityRoleUpdateDto> IdentityRoleUpdateDto>
{ {

8
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; 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(); var totalCount = await RoleRepository.GetCountAsync();
return new PagedResultDto<IdentityRoleDto>( return new PagedResultDto<IdentityRoleDto>(
@ -57,7 +57,7 @@ namespace Volo.Abp.Identity
CurrentTenant.Id CurrentTenant.Id
) )
{ {
IsDefault = input.IsDefault, IsDefault = input.IsDefault,
IsPublic = input.IsPublic IsPublic = input.IsPublic
}; };

3
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs

@ -1,13 +1,12 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Dtos;
using Volo.Abp.BlazoriseUI; using Volo.Abp.BlazoriseUI;
using Volo.Abp.PermissionManagement.Blazor.Components; using Volo.Abp.PermissionManagement.Blazor.Components;
namespace Volo.Abp.Identity.Blazor.Pages.Identity 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"; protected const string PermissionProviderName = "R";

2
modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs

@ -27,7 +27,7 @@ namespace Volo.Abp.Identity
} }
[HttpGet] [HttpGet]
public virtual Task<PagedResultDto<IdentityRoleDto>> GetListAsync(PagedAndSortedResultRequestDto input) public virtual Task<PagedResultDto<IdentityRoleDto>> GetListAsync(GetIdentityRolesInput input)
{ {
return RoleAppService.GetListAsync(input); return RoleAppService.GetListAsync(input);
} }

4
modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs

@ -45,13 +45,13 @@ namespace Volo.Abp.Identity
result.Items.Count.ShouldBeGreaterThan(0); result.Items.Count.ShouldBeGreaterThan(0);
} }
[Fact] [Fact]
public async Task GetListAsync() public async Task GetListAsync()
{ {
//Act //Act
var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); var result = await _roleAppService.GetListAsync(new GetIdentityRolesInput());
//Assert //Assert

Loading…
Cancel
Save