2021-12-03 15:03:33 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
2022-10-26 15:36:49 +05:00
|
|
|
|
using AsbCloudApp.Services;
|
2021-12-11 16:46:04 +05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
2022-10-26 15:36:49 +05:00
|
|
|
|
using System.Threading;
|
2021-12-03 15:03:33 +05:00
|
|
|
|
|
2022-10-26 15:36:49 +05:00
|
|
|
|
namespace AsbCloudApp.Repositories
|
2021-12-03 15:03:33 +05:00
|
|
|
|
{
|
2022-10-26 15:36:49 +05:00
|
|
|
|
#nullable enable
|
2022-08-09 11:10:01 +05:00
|
|
|
|
/// <summary>
|
2022-10-26 15:36:49 +05:00
|
|
|
|
/// Разрешения на доступ к данным
|
2022-08-09 11:10:01 +05:00
|
|
|
|
/// </summary>
|
2022-12-01 15:56:11 +05:00
|
|
|
|
public interface IUserRoleRepository : ICrudRepository<UserRoleDto>
|
2021-12-03 15:03:33 +05:00
|
|
|
|
{
|
2022-08-09 11:10:01 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить dto по названиям
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="names"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2022-10-27 14:18:59 +05:00
|
|
|
|
Task<IEnumerable<UserRoleDto>> GetByNamesAsync(IEnumerable<string> names, CancellationToken token = default);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить все вложенные разрешения
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="counter"></param>
|
|
|
|
|
/// <returns></returns>
|
2022-10-27 14:18:59 +05:00
|
|
|
|
IEnumerable<UserRoleDto> GetNestedById(int id, int counter = 10);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// определяет содержится ли разрешение в одной из указанных ролей
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="rolesIds"></param>
|
|
|
|
|
/// <param name="permissionName"></param>
|
|
|
|
|
/// <returns></returns>
|
2021-12-16 16:00:47 +05:00
|
|
|
|
bool HasPermission(IEnumerable<int> rolesIds, string permissionName);
|
2021-12-03 15:03:33 +05:00
|
|
|
|
}
|
2022-10-26 15:36:49 +05:00
|
|
|
|
#nullable disable
|
|
|
|
|
}
|