nit remove unused methods

This commit is contained in:
ngfrolov 2022-08-12 12:36:11 +05:00
parent 87e594f5c0
commit ab278f6a2f
6 changed files with 2 additions and 62 deletions

View File

@ -15,7 +15,7 @@ namespace AsbCloudApp.Data.SAUB
/// <summary>
/// метка времени данных (legacy)
/// </summary>
public DateTime Date // TODO: remove this legacy after all panels updated
public DateTime Date // TODO: remove this legacy after all panels updated (> 3.2.0407)
{
get { return DateTime; }
set { DateTime = value; }

View File

@ -10,15 +10,6 @@ namespace AsbCloudApp.Services
/// </summary>
public interface IUserRoleService : ICrudService<UserRoleDto>
{
// todo: скорее всего не используется
/// <summary>
///
/// </summary>
/// <param name="name"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<UserRoleDto> GetByNameAsync(string name, CancellationToken token = default);
// todo: переименовать
/// <summary>
/// получить dto по названиям

View File

@ -28,24 +28,6 @@ namespace AsbCloudApp.Services
/// <returns></returns>
IEnumerable<UserRoleDto> GetRolesByIdUser(int idUser, int nestedLevel = 0);
// TODO: скорее всего не используется
/// <summary>
///
/// </summary>
/// <param name="idUser"></param>
/// <param name="roleNames"></param>
/// <returns></returns>
bool HasAnyRoleOf(int idUser, IEnumerable<string> roleNames);
// TODO: скорее всего не используется
/// <summary>
///
/// </summary>
/// <param name="idUser"></param>
/// <param name="roleIds"></param>
/// <returns></returns>
bool HasAnyRoleOf(int idUser, IEnumerable<int> roleIds);
/// <summary>
/// определяет есть ли у пользователя указанное разрешение
/// </summary>

View File

@ -49,9 +49,8 @@ namespace AsbCloudApp.Services
/// <returns></returns>
Task<string> GetWellCaptionByIdAsync(int idWell, CancellationToken token);
//TODO: remove that
/// <summary>
///
/// список компаний участвующих в скважине
/// </summary>
/// <param name="idWell"></param>
/// <param name="token"></param>

View File

@ -75,16 +75,6 @@ namespace AsbCloudInfrastructure.Services
return dto;
}
public async Task<UserRoleDto> GetByNameAsync(string name, CancellationToken token = default)
{
var entity = await cacheUserRoles.FirstOrDefaultAsync(r => r.Caption == name, token)
.ConfigureAwait(false);
if (entity is null)
return null;
var dto = Convert(entity);
return dto;
}
public async Task<IEnumerable<UserRoleDto>> GetByNamesAsync(IEnumerable<string> names, CancellationToken token = default)
{
if (names?.Any() != true)

View File

@ -167,28 +167,6 @@ namespace AsbCloudInfrastructure.Services
}), token).ConfigureAwait(false);
}
public bool HasAnyRoleOf(int idUser, IEnumerable<string> roleNames)
{
if (!roleNames.Any())
return true;
var userRoleNames = GetRolesNamesByIdUser(idUser);
foreach (var roleName in userRoleNames)
if (roleNames.Contains(roleName))
return true;
return false;
}
public bool HasAnyRoleOf(int idUser, IEnumerable<int> roleIds)
{
if (!roleIds.Any())
return true;
var userRoles = GetRolesByIdUser(idUser);
foreach (var role in userRoles)
if (roleIds.Contains(role.Id))
return true;
return false;
}
public bool HasPermission(int idUser, string permissionName)
{
if (idUser == 1)