Search Results for

    Show / Hide Table of Contents

    Interface IAccount

    Описывает интерфейс учётной записи пользователя.

    Inherited Members
    IDivisionMember.DivisionId
    ITrustee.TrusteeId
    ITrustee.AllowAllDiagrams
    ITrustee.AllowAllReports
    ITrustee.AllowAllNodes
    ITrustee.AllowAllDashboards
    ITrustee.IsSystem
    Namespace: Lers.Administration
    Assembly: Lers.Server.System.dll
    Syntax
    public interface IAccount : IDivisionMember, ITrustee

    Properties

    AuthenticationModes

    Declaration
    AccountAuthenticationMode AuthenticationModes { get; }
    Property Value
    Type Description
    AccountAuthenticationMode

    DataStartDate

    Дата, начиная с которой пользователю разрешено запрашивать данные.

    Declaration
    DateTime? DataStartDate { get; }
    Property Value
    Type Description
    System.Nullable<DateTime>

    Description

    Описание учетной записи.

    Declaration
    string Description { get; }
    Property Value
    Type Description
    System.String

    DisablePasswordChange

    Запретить смену пароля пользователем.

    Declaration
    bool DisablePasswordChange { get; }
    Property Value
    Type Description
    System.Boolean

    DisplayName

    Отображаемое имя учётной записи.

    Declaration
    string DisplayName { get; }
    Property Value
    Type Description
    System.String

    EMail

    EMail учётной записи.

    Declaration
    string EMail { get; }
    Property Value
    Type Description
    System.String

    ExpirationDate

    Declaration
    DateTime? ExpirationDate { get; }
    Property Value
    Type Description
    System.Nullable<DateTime>

    FailedLoginCount

    Количество неудачных попыток входа.

    Declaration
    byte FailedLoginCount { get; }
    Property Value
    Type Description
    System.Byte

    ForceChangePassword

    Пользователь должен сменить пароль при следующем входе в систему.

    Declaration
    bool ForceChangePassword { get; }
    Property Value
    Type Description
    System.Boolean

    Id

    Уникальный идентификатор учётной записи.

    Declaration
    int Id { get; }
    Property Value
    Type Description
    System.Int32

    Identifier

    Типизированный идентификатор учётной записи (для использования вместо Id).

    Declaration
    EntityIdentifier<Account> Identifier { get; }
    Property Value
    Type Description
    EntityIdentifier<Lers.Models.Account>

    IpAddressListMode

    Режим использования списка IP-адресов, связанных с учетной записью. true - разрешен вход только с IP-адресов, указанных в списке; false - разрешен вход с любых IP-адресов, кроме указанных в списке;

    Declaration
    bool IpAddressListMode { get; }
    Property Value
    Type Description
    System.Boolean

    IsAdmin

    Указывает что учётная запись обладает правами администратора.

    Declaration
    bool IsAdmin { get; }
    Property Value
    Type Description
    System.Boolean

    IsDisabled

    Указывает что учётная запись отключена.

    Declaration
    bool IsDisabled { get; }
    Property Value
    Type Description
    System.Boolean

    LastLoginTryDate

    Время последней неудачной попытки входа.

    Declaration
    DateTimeOffset? LastLoginTryDate { get; }
    Property Value
    Type Description
    System.Nullable<DateTimeOffset>

    Login

    Имя входа.

    Declaration
    string Login { get; }
    Property Value
    Type Description
    System.String

    LoginNotAllowed

    Отмечает запрещён ли вход данной учётной записи.

    Declaration
    bool LoginNotAllowed { get; }
    Property Value
    Type Description
    System.Boolean

    LoginNotAllowedUntil

    Время до которого учётной записи запрещён вход из-за превышения количества неудачных попыток входа.

    Declaration
    DateTimeOffset? LoginNotAllowedUntil { get; }
    Property Value
    Type Description
    System.Nullable<DateTimeOffset>

    MobilePhone

    Номер телефона.

    Declaration
    string MobilePhone { get; }
    Property Value
    Type Description
    System.String

    Model

    Возвращает пригодную для сериализации модель учётной записи.

    Declaration
    Account Model { get; }
    Property Value
    Type Description
    Lers.Models.Account

    OneTimePasswordType

    Указывает, что пользователь должен входить с использованием многофакторной аутентификации.

    Declaration
    OneTimePasswordType OneTimePasswordType { get; }
    Property Value
    Type Description
    Lers.Models.OneTimePasswordType

    PasswordDoesNotExpire

    Отмечает, что пароль не имеет срока действия.

    Declaration
    bool PasswordDoesNotExpire { get; }
    Property Value
    Type Description
    System.Boolean

    PasswordSetDate

    Дата установки пароля.

    Declaration
    DateTimeOffset PasswordSetDate { get; }
    Property Value
    Type Description
    DateTimeOffset

    SendOneTimePassword

    Указывает, что код для многофакторного входа нужно отправить клиенту через telegram, SMS или e-mail.

    Declaration
    bool SendOneTimePassword { get; }
    Property Value
    Type Description
    System.Boolean

    SendSmsViaModem

    Указывает что SMS учётной записи должны отправляться через модем.

    Declaration
    bool SendSmsViaModem { get; }
    Property Value
    Type Description
    System.Boolean

    SessionTimeout

    Declaration
    TimeSpan SessionTimeout { get; }
    Property Value
    Type Description
    TimeSpan

    SmsEMail

    EMail для отправки SMS через шлюз.

    Declaration
    string SmsEMail { get; }
    Property Value
    Type Description
    System.String

    StateParametrs

    Параметры нештатных ситуаций для учёта в расчёте состояния точек учёта для УЗ.

    Declaration
    AccountStateParameters StateParametrs { get; }
    Property Value
    Type Description
    Lers.Models.AccountStateParameters

    TenantOfficeonly

    Указывает, что пользователю разрешён только личный кабинет жильца.

    Declaration
    bool TenantOfficeonly { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    AllowRoom(EntityIdentifier<Room>)

    Разрешает учётной записи доступ к уазанному помещению.

    Declaration
    void AllowRoom(EntityIdentifier<Room> roomId)
    Parameters
    Type Name Description
    EntityIdentifier<Lers.Models.Room> roomId

    GetAccountNodesExplicit()

    Declaration
    IList<AccountNode> GetAccountNodesExplicit()
    Returns
    Type Description
    IList<Lers.Models.AccountNode>

    GetAllowedMeasurePointIds()

    Возвращает идентификаторы точек учёта, доступных для учётной записи.

    Declaration
    IEnumerable<int> GetAllowedMeasurePointIds()
    Returns
    Type Description
    IEnumerable<System.Int32>

    GetGrantedPermissions()

    Получает действующие разрешения для учетной записи.

    Declaration
    ICollection<AccessRight> GetGrantedPermissions()
    Returns
    Type Description
    ICollection<AccessRight>

    Список действующих разрешений.

    GetMeasurePointNotes(Nullable<EntityIdentifier<MeasurePoint>>, Nullable<EntityIdentifier<Node>>)

    Возвращает личные заметки пользователя об точке (точках) учёта.

    Declaration
    Task<Dictionary<int, string>> GetMeasurePointNotes(EntityIdentifier<MeasurePoint>? measurePointId = null, EntityIdentifier<Node>? nodeId = null)
    Parameters
    Type Name Description
    System.Nullable<EntityIdentifier<Lers.Models.MeasurePoint>> measurePointId
    System.Nullable<EntityIdentifier<Lers.Models.Node>> nodeId
    Returns
    Type Description
    Task<Dictionary<System.Int32, System.String>>

    GetModel()

    Возвращает базовые параметры учетной записи.

    Declaration
    Account GetModel()
    Returns
    Type Description
    Lers.Models.Account

    GetNodeNotes(Nullable<EntityIdentifier<Node>>)

    Возвращает личные заметки пользователя об объекте (объектах) учёта.

    Declaration
    Task<Dictionary<int, string>> GetNodeNotes(EntityIdentifier<Node>? nodeId)
    Parameters
    Type Name Description
    System.Nullable<EntityIdentifier<Lers.Models.Node>> nodeId
    Returns
    Type Description
    Task<Dictionary<System.Int32, System.String>>

    GetNotificationTypeParameters(NotificationType)

    Возвращает параметры уведомлений учётной записи.

    Declaration
    NotificationTypeModel GetNotificationTypeParameters(NotificationType notificationType)
    Parameters
    Type Name Description
    NotificationType notificationType
    Returns
    Type Description
    Lers.Models.NotificationTypeModel

    GetPublicModel()

    Возвращает публичную информацию об учётной записи.

    Declaration
    PublicAccount GetPublicModel()
    Returns
    Type Description
    Lers.Models.PublicAccount

    InvalidateLoginTokens()

    Увеличивает версию токена, чтобы ранее выданные JWT токены стали недействительными.

    Declaration
    void InvalidateLoginTokens()

    IsAllGranted(AccessRight[])

    Возвращает значение, определяющее, обладает ли учетная запись всеми указанными разрешениями.

    Declaration
    bool IsAllGranted(params AccessRight[] accessRights)
    Parameters
    Type Name Description
    AccessRight[] accessRights

    Разрешения.

    Returns
    Type Description
    System.Boolean

    Возвращает true, если текущая учетная запись обладает всеми указанными разрешениями, иначе - false.

    IsAnyGranted(AccessRight[])

    Вернёт true если у учётной записи есть хотя бы одно из указанных разрешений.

    Declaration
    bool IsAnyGranted(params AccessRight[] accessRights)
    Parameters
    Type Name Description
    AccessRight[] accessRights
    Returns
    Type Description
    System.Boolean

    IsGranted(AccessRight)

    Вернёт true если пользователь обладает указанным правом доступа.

    Declaration
    bool IsGranted(AccessRight accessRight)
    Parameters
    Type Name Description
    AccessRight accessRight

    Проверяемое право доступа.

    Returns
    Type Description
    System.Boolean

    IsMeasurePointAllowed(EntityIdentifier<MeasurePoint>)

    Проверяет доступна ли точка учёта для данной учётной записи.

    Declaration
    bool IsMeasurePointAllowed(EntityIdentifier<MeasurePoint> measurePointId)
    Parameters
    Type Name Description
    EntityIdentifier<Lers.Models.MeasurePoint> measurePointId
    Returns
    Type Description
    System.Boolean

    IsMeasurePointAllowedAsync(EntityIdentifier<MeasurePoint>)

    Асинхронно проверяет доступна ли точка учёта для данной учётной записи.

    Declaration
    ValueTask<bool> IsMeasurePointAllowedAsync(EntityIdentifier<MeasurePoint> measurePointId)
    Parameters
    Type Name Description
    EntityIdentifier<Lers.Models.MeasurePoint> measurePointId
    Returns
    Type Description
    ValueTask<System.Boolean>

    IsNodeAllowed(EntityIdentifier)

    Проверяет доступен ли объект для данной учётной записи.

    Declaration
    bool IsNodeAllowed(EntityIdentifier nodeId)
    Parameters
    Type Name Description
    EntityIdentifier nodeId
    Returns
    Type Description
    System.Boolean

    IsNodeAllowedAsync(EntityIdentifier)

    Асинхронно проверяет доступен ли объект для данной учётной записи.

    Declaration
    ValueTask<bool> IsNodeAllowedAsync(EntityIdentifier nodeId)
    Parameters
    Type Name Description
    EntityIdentifier nodeId
    Returns
    Type Description
    ValueTask<System.Boolean>

    IsRoomAllowed(EntityIdentifier<Room>)

    Проверяет доступно ли помещение для данной учётной записи.

    Declaration
    bool IsRoomAllowed(EntityIdentifier<Room> roomId)
    Parameters
    Type Name Description
    EntityIdentifier<Lers.Models.Room> roomId
    Returns
    Type Description
    System.Boolean

    ProcessFailedLoginTry()

    Обрабатывает попытку неверного входа.

    Declaration
    void ProcessFailedLoginTry()

    ProcessSuccessfulLogin()

    Обрабатывает попытку успешного входа.

    Declaration
    void ProcessSuccessfulLogin()

    ReloadAllowedEntitiesCache()

    Перезагружает из БД список разрешённых сущностей.

    Declaration
    void ReloadAllowedEntitiesCache()
    Remarks

    Без вызова этого метода можно обойтись, но тогда каждый вызов Is(Node/MeasurePoint/Room)Allowed приведёт к одному запросу к БД. В случае фильтрации большого списка это может снизить производительность. Поэтому перед выполнением можно перезагрузить кэш.

    SendEmail(String, String, IAccount)

    Отправляет электронную почту учётной записи.

    Declaration
    void SendEmail(string subject, string message, IAccount sender = null)
    Parameters
    Type Name Description
    System.String subject
    System.String message
    IAccount sender

    SendEmail(String, String, Nullable<IEnumerable<MessageEntryAttachment>>, MessageFormat, String, IAccount)

    Отправляет учетной записи e-mail сообщение.

    Declaration
    void SendEmail(string subject, string message, IEnumerable<MessageEntryAttachment>? attachments, MessageFormat messageFormat, string senderName, IAccount sender = null)
    Parameters
    Type Name Description
    System.String subject

    Тема сообщения.

    System.String message

    Текст сообщения.

    System.Nullable<IEnumerable<Lers.Models.MessageEntryAttachment>> attachments

    Список вложений.

    Lers.Interop.MessageFormat messageFormat

    Формат сообщения.

    System.String senderName

    Имя отправителя, или null если его нужно сформировать автоматически.

    IAccount sender

    SendNotification(String, INodeJob)

    Отправляет уведомление учётной записи.

    Declaration
    void SendNotification(string message, INodeJob nodeJob = null)
    Parameters
    Type Name Description
    System.String message
    INodeJob nodeJob

    Работа на объекте, с которой связано уведомление.

    SendSms(String, IAccount)

    Отправляет учётной записи SMS-сообщение.

    Declaration
    void SendSms(string message, IAccount sender = null)
    Parameters
    Type Name Description
    System.String message
    IAccount sender

    SetMeasurePointNote(EntityIdentifier<MeasurePoint>, String)

    Сохраняет заметку по точке учёта.

    Declaration
    Task SetMeasurePointNote(EntityIdentifier<MeasurePoint> id, string text)
    Parameters
    Type Name Description
    EntityIdentifier<Lers.Models.MeasurePoint> id
    System.String text
    Returns
    Type Description
    Task

    SetNodeNote(EntityIdentifier<Node>, String)

    Сохраняет заметку по объекту.

    Declaration
    Task SetNodeNote(EntityIdentifier<Node> id, string text)
    Parameters
    Type Name Description
    EntityIdentifier<Lers.Models.Node> id
    System.String text
    Returns
    Type Description
    Task

    SetPassword(Byte[], Byte[], DateTimeOffset, Boolean)

    Устанавливает новый пароль для учётной записи.

    Declaration
    void SetPassword(byte[] salt, byte[] passwordHash, DateTimeOffset serverNow, bool isOwn)
    Parameters
    Type Name Description
    System.Byte[] salt
    System.Byte[] passwordHash
    DateTimeOffset serverNow
    System.Boolean isOwn

    Указывает, что пользователь сам себе установил пароль.

    ToServiceman()

    Преобразовывает учётную запись в обслуживающего инженера.

    Declaration
    Serviceman ToServiceman()
    Returns
    Type Description
    Lers.Models.Serviceman

    Unblock()

    Разблокирует учётную запись, чтобы ей был разрешён вход.

    Declaration
    void Unblock()

    UpdateLastLoginTime(DateTime)

    Declaration
    void UpdateLastLoginTime(DateTime dateTime)
    Parameters
    Type Name Description
    DateTime dateTime

    Extension Methods

    AccountExtensions.IsNodeAllowed(IAccount, INode)
    AccountExtensions.IsMeasurePointAllowedAsync(IAccount, IMeasurePoint)
    AccountExtensions.IsNodeAllowedAsync(IAccount, INode)
    AccountExtensions.IsMeasurePointAllowed(IAccount, IMeasurePoint)
    AccountExtensions.IsAccountGroupAllowed(IAccount, AccountGroup)
    AccountExtensions.ValidateCanExecuteRequest(IAccount)
    In This Article
    Back to top ©2018 - 2026, ООО "ЛЭРС УЧЁТ"