forked from ddrilling/AsbCloudServer
nit remove unused methods
This commit is contained in:
parent
87e594f5c0
commit
ab278f6a2f
@ -15,7 +15,7 @@ namespace AsbCloudApp.Data.SAUB
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// метка времени данных (legacy)
|
/// метка времени данных (legacy)
|
||||||
/// </summary>
|
/// </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; }
|
get { return DateTime; }
|
||||||
set { DateTime = value; }
|
set { DateTime = value; }
|
||||||
|
@ -10,15 +10,6 @@ namespace AsbCloudApp.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IUserRoleService : ICrudService<UserRoleDto>
|
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: переименовать
|
// todo: переименовать
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// получить dto по названиям
|
/// получить dto по названиям
|
||||||
|
@ -28,24 +28,6 @@ namespace AsbCloudApp.Services
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerable<UserRoleDto> GetRolesByIdUser(int idUser, int nestedLevel = 0);
|
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>
|
||||||
/// определяет есть ли у пользователя указанное разрешение
|
/// определяет есть ли у пользователя указанное разрешение
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -49,9 +49,8 @@ namespace AsbCloudApp.Services
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<string> GetWellCaptionByIdAsync(int idWell, CancellationToken token);
|
Task<string> GetWellCaptionByIdAsync(int idWell, CancellationToken token);
|
||||||
|
|
||||||
//TODO: remove that
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// список компаний участвующих в скважине
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="idWell"></param>
|
/// <param name="idWell"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
|
@ -75,16 +75,6 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
return dto;
|
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)
|
public async Task<IEnumerable<UserRoleDto>> GetByNamesAsync(IEnumerable<string> names, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
if (names?.Any() != true)
|
if (names?.Any() != true)
|
||||||
|
@ -167,28 +167,6 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
}), token).ConfigureAwait(false);
|
}), 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)
|
public bool HasPermission(int idUser, string permissionName)
|
||||||
{
|
{
|
||||||
if (idUser == 1)
|
if (idUser == 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user