Table of Contents

Class User

Namespace
ATAS.DataFeedsCore
Assembly
ATAS.DataFeedsCore.dll

User account of the ATAS trading server.

public class User : IEntity
Inheritance
object
User
Implements
Extension Methods

Constructors

User()

Creates an empty user.

public User()

User(string, string)

Creates a user with a login and a password; a new salt is generated and the password is stored as a hash.

public User(string login, string password)

Parameters

login string

Login name.

password string

Plain-text password.

Exceptions

ArgumentNullException

login or password is null.

Properties

Address

Postal address; null when not set.

public string? Address { get; set; }

Property Value

string

Country

Country; null when not set.

public string? Country { get; set; }

Property Value

string

Description

Free-text description; null when not set.

public string? Description { get; set; }

Property Value

string

Email

E-mail address; null when not set.

public string? Email { get; set; }

Property Value

string

EntityType

Always User.

[Browsable(false)]
public EntityType EntityType { get; }

Property Value

EntityType

ExpiryDate

Date the user access expires; changed by UserChangeTypes requests. null when not set.

public DateTime? ExpiryDate { get; set; }

Property Value

DateTime?

Group

Group the user belongs to; setting it also updates GroupId.

public UserGroup? Group { get; set; }

Property Value

UserGroup

GroupId

Identifier of the user Group.

[Browsable(false)]
public long GroupId { get; set; }

Property Value

long

Id

Database identifier of the user; setting it re-links Portfolios to this user.

[Browsable(false)]
public long Id { get; set; }

Property Value

long

IsLocked

true when the user is locked and cannot log on.

[Browsable(false)]
public bool IsLocked { get; set; }

Property Value

bool

IsOnline

true while the user has a session on the server; not stored in the database.

[Browsable(false)]
public bool IsOnline { get; set; }

Property Value

bool

LastLogonTime

Time of the last logon; null when the user has never logged on.

public DateTime? LastLogonTime { get; set; }

Property Value

DateTime?

Login

Login name.

public string Login { get; set; }

Property Value

string

Name

Display name of the user.

public string Name { get; set; }

Property Value

string

Password

Base64 SHA-256 hash of Salt followed by the password; not the password itself.

public string Password { get; set; }

Property Value

string

Phone

Phone number; null when not set.

public string? Phone { get; set; }

Property Value

string

PortfolioViewers

Viewer entries of the user: portfolios of other users the user is allowed to view. Created on first access.

[Browsable(false)]
public List<PortfolioViewer> PortfolioViewers { get; }

Property Value

List<PortfolioViewer>

Portfolios

Portfolios owned by the user.

[Browsable(false)]
public List<Portfolio> Portfolios { get; }

Property Value

List<Portfolio>

Role

Role that defines the user permissions; setting it also updates RoleId.

public UserRole? Role { get; set; }

Property Value

UserRole

RoleId

Identifier of the user Role.

[Browsable(false)]
public long RoleId { get; set; }

Property Value

long

Salt

Random salt prepended to the password before hashing.

[Browsable(false)]
public string Salt { get; set; }

Property Value

string

Zip

Postal code; null when not set.

public string? Zip { get; set; }

Property Value

string

Methods

Check(string)

Checks a password against the stored hash.

public bool Check(string password)

Parameters

password string

Plain-text password.

Returns

bool

true when the password matches; after SetFakePassword() the given password is stored first, so the check succeeds.

OnPropertyChanged(string)

protected virtual void OnPropertyChanged(string propertyName)

Parameters

propertyName string

Name of the changed property.

SetFakePassword()

Replaces the password with a placeholder: the next Check(string) accepts any password and stores it as the new one.

public void SetFakePassword()

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Update(string)

Sets a new password: generates a new Salt and stores the hash.

public void Update(string password)

Parameters

password string

Plain-text password.

Events

PropertyChanged

Occurs when a property changes.

        <p>Added in ATAS 8.0.15.</p>
public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler