|
|
@ -23,6 +23,14 @@ namespace BaseService.UserManagement |
|
|
|
_repository = roleRepository; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public async Task<ListResultDto<IdentityRoleDto>> GetAllAsync() |
|
|
|
{ |
|
|
|
var items = await _repository.GetListAsync().ConfigureAwait(false); |
|
|
|
var dtos = ObjectMapper.Map<List<IdentityRole>, List<IdentityRoleDto>>(items); |
|
|
|
return new ListResultDto<IdentityRoleDto>(dtos); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public async Task<PagedResultDto<IdentityRoleDto>> GetListAsync(GetIdentityRolesInput input) |
|
|
|
{ |
|
|
@ -33,6 +41,15 @@ namespace BaseService.UserManagement |
|
|
|
return new PagedResultDto<IdentityRoleDto>(totalCount, dtos); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet("{id}")] |
|
|
|
[Authorize(IdentityPermissions.Roles.Delete)] |
|
|
|
public async Task<IdentityRoleDto> Details(Guid id) |
|
|
|
{ |
|
|
|
var role = await _roleManager.GetByIdAsync(id).ConfigureAwait(false); |
|
|
|
var dto = ObjectMapper.Map<IdentityRole, IdentityRoleDto>(role); |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
[Authorize(IdentityPermissions.Roles.Create)] |
|
|
|
public async Task<IdentityRoleDto> CreateAsync(IdentityRoleCreateDto input) |
|
|
|