forked from ddrilling/AsbCloudServer
#7205798 fix
This commit is contained in:
parent
e908d6a655
commit
2e1f49e704
@ -99,8 +99,6 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
await AssertLoginIsBusyAsync(dto.Login, token);
|
await AssertLoginIsBusyAsync(dto.Login, token);
|
||||||
|
|
||||||
var userRoles = await userRoleRepository.GetByNamesAsync(dto.RoleNames, token).ConfigureAwait(false);
|
var userRoles = await userRoleRepository.GetByNamesAsync(dto.RoleNames, token).ConfigureAwait(false);
|
||||||
|
|
||||||
if (userRoles is not null)
|
|
||||||
await UpdateRolesCacheForUserAsync(dto.Id, userRoles, token);
|
await UpdateRolesCacheForUserAsync(dto.Id, userRoles, token);
|
||||||
|
|
||||||
var entity = Convert(dto);
|
var entity = Convert(dto);
|
||||||
@ -127,9 +125,6 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
public IEnumerable<UserRoleDto> GetRolesByIdUser(int idUser, int nestedLevel = 0)
|
public IEnumerable<UserRoleDto> GetRolesByIdUser(int idUser, int nestedLevel = 0)
|
||||||
{
|
{
|
||||||
var roles = GetCachRelationUserUserRoleCacheTag().Where(r => r.IdUser == idUser);
|
var roles = GetCachRelationUserUserRoleCacheTag().Where(r => r.IdUser == idUser);
|
||||||
if (roles is null)
|
|
||||||
return Enumerable.Empty<UserRoleDto>();
|
|
||||||
|
|
||||||
return roles.SelectMany(r => userRoleRepository.GetNestedById(r.IdUserRole, nestedLevel));
|
return roles.SelectMany(r => userRoleRepository.GetNestedById(r.IdUserRole, nestedLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +156,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
|
|
||||||
private IEnumerable<string>? GetRolesNamesByIdUser(int idUser)
|
private IEnumerable<string>? GetRolesNamesByIdUser(int idUser)
|
||||||
=> GetRolesByIdUser(idUser, 7)
|
=> GetRolesByIdUser(idUser, 7)
|
||||||
?.Select(r => r.Caption)
|
.Select(r => r.Caption)
|
||||||
.Distinct();
|
.Distinct();
|
||||||
|
|
||||||
private async Task AssertLoginIsBusyAsync(string login, CancellationToken token = default)
|
private async Task AssertLoginIsBusyAsync(string login, CancellationToken token = default)
|
||||||
|
Loading…
Reference in New Issue
Block a user