Class: User

User

Class representing a User, allowing access management (if required) and user's actions tracking.

Constructor

new User(username, grantType, badgeNumber, fingers)

User default constructor.
Parameters:
Name Type Description
username string Username.
grantType GrantType Type of access to the current device (see GrantType).
badgeNumber string Badge number.
fingers Map Enrolled fingers. [key: FingerIndex, value: base64-encoded Template]

Methods

(static) deserialize(xmlData) → {User|null}

Create a new User instance from a serialized one.
Parameters:
Name Type Description
xmlData Serialized User (xml format).
Returns:
Deserialized User. Or null if the serialized data is invalid.
Type
User | null

getBadgeNumber() → {string}

Returns:
Badge number.
Type
string

getEnrolledFingersIndexes() → {Array.<FingerIndex>}

Returns:
Indexes of enrolled fingers.
Type
Array.<FingerIndex>

getFingerprintTemplate() → {string}

Returns:
Base64-encoded template corresponding to the finger, or null if no value is available.
Type
string

getPermission() → {GrantType}

Returns:
Type of permission.
Type
GrantType

getUsername() → {string}

Returns:
Username.
Type
string

serialize() → {string}

Format the internal data as an XML string and encode it with base64.
Returns:
The base64 encoded XML User.
Type
string