2021-03-27 23:50:29 +04:00
|
|
|
|
using ModelTools.Models;
|
2021-03-28 10:23:26 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
2021-03-26 20:09:52 +04:00
|
|
|
|
|
|
|
|
|
namespace ModelTools.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface ISecurityManager
|
|
|
|
|
{
|
2021-03-28 10:23:26 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Аутентифицированный пользователь
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Guid? User { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список ролей аутентифицированного пользователь
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Guid> Roles { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Выполнена ли аутентификация
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsAuth { get; }
|
|
|
|
|
|
2021-03-26 20:09:52 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Сообщение с причиной не получения доступа
|
|
|
|
|
/// </summary>
|
|
|
|
|
string ErrorMessage { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Авторизация пользователя к операции
|
|
|
|
|
/// </summary>
|
2021-03-27 23:50:29 +04:00
|
|
|
|
/// <param name="model">Данные по операции</param>
|
2021-03-26 20:09:52 +04:00
|
|
|
|
/// <returns></returns>
|
2021-03-27 23:50:29 +04:00
|
|
|
|
bool CheckAccess(SecurityManagerCheckAccessModel model);
|
2021-03-28 00:15:01 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Проверка наличия старотвых данных для работы с ситемой
|
|
|
|
|
/// </summary>
|
|
|
|
|
void CheckStartDataSource();
|
2021-03-28 10:23:26 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Аутентификация пользователя
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="login"></param>
|
|
|
|
|
/// <param name="password"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task LoginAsync(string login, string password);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Выход из системы
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task LogoutAsync();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Смена пароля
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="login"></param>
|
|
|
|
|
/// <param name="oldPassword"></param>
|
|
|
|
|
/// <param name="newPassword"></param>
|
|
|
|
|
Task ChangePassword(string login, string oldPassword, string newPassword);
|
2021-03-26 20:09:52 +04:00
|
|
|
|
}
|
|
|
|
|
}
|