Namespace

directory

kiss.directory

Directory to handle users and groups

View Source client/core/modules/directory.js, line 8

Methods

# static addApiClient(client)

Add an API client

Parameters:
Name Type Description
client object

View Source client/core/modules/directory.js, line 298

# static addGroup(group)

Add a group

Parameters:
Name Type Description
group object

View Source client/core/modules/directory.js, line 267

# static addUser(user)

Add a user

Parameters:
Name Type Description
user object

View Source client/core/modules/directory.js, line 236

# static deleteApiClient(clientId)

Delete an API client

Parameters:
Name Type Description
clientId string

View Source client/core/modules/directory.js, line 320

# static deleteGroup(groupId)

Delete a group

Parameters:
Name Type Description
groupId string

View Source client/core/modules/directory.js, line 289

# static deleteUser(userId)

Delete a user

Parameters:
Name Type Description
userId string

View Source client/core/modules/directory.js, line 258

# static editUsername(userId)

Dialog to change the user first name and last name

Parameters:
Name Type Description
userId string

View Source client/core/modules/directory.js, line 623

# static getApiClients() → {Array.<object>}

Get API clients

View Source client/core/modules/directory.js, line 568

Array of API clients

Array.<object>

# static getEntries(entryId) → {Array.<object>}

Get a list of users and groups, given their ids

Parameters:
Name Type Description
entryId Array.<string>

Array of ids

View Source client/core/modules/directory.js, line 394

Array of entries

Array.<object>

# static getEntry(entryId)

Get a user or a group, given its email (for users) or id (for groups)

Parameters:
Name Type Description
entryId string

View Source client/core/modules/directory.js, line 384

# static getEntryColor(userId) → {string}

Get the entry color (randomly assigned at startup)

Parameters:
Name Type Description
userId string

View Source client/core/modules/directory.js, line 489

The hex color code

string
Example
const userColor = kiss.directory.getEntryColor("david.grossi@pickaform.com")
console.log(userColor) // "#00aaee"

# static getEntryName(userId) → {string}

Returns the user name

Parameters:
Name Type Description
userId string

View Source client/core/modules/directory.js, line 404

string

# static getEntryNames(entryId) → {Array.<string>}

Get a list of user and group names, given their ids

Parameters:
Name Type Description
entryId Array.<string>

Array of ids

View Source client/core/modules/directory.js, line 433

Array of entry names

Array.<string>

# static getGroups(sortOrder) → {Array.<object>}

Get groups

Parameters:
Name Type Description
sortOrder string

"asc" (default) | "desc"

View Source client/core/modules/directory.js, line 548

Array of groups

Array.<object>

# static getUserACL(userId) → {Array.<string>}

Returns all the names by which the user can be recognized into ACL lists.

Parameters:
Name Type Description
userId string

View Source client/core/modules/directory.js, line 444

Array.<string>

# static getUserInitials(user) → {string}

Get the user initials

Parameters:
Name Type Description
user object

View Source client/core/modules/directory.js, line 473

The initials

string
Example
const initials = kiss.directory.getUserInitials("david.grossi@pickaform.com")
console.log(initials) // "DG"

# static getUsers(config) → {Array.<object>}

Get users

Parameters:
Name Type Description
config object
sortBy string

"firstName" | "lastName" (default)

nameOrder string

"firstName" | "lastName" (default)

sortOrder string

"asc" (default) | "desc"

onlyActiveUsers boolean

true to filter out inactive users

View Source client/core/modules/directory.js, line 508

Array of users

Array.<object>

# static init() → {Promise.<boolean>}

Init the address book

View Source client/core/modules/directory.js, line 22

false if users or groups could not be loaded properly

Promise.<boolean>

# static updateApiClient(clientId, update)

Update an API client

Parameters:
Name Type Description
clientId string
update object

View Source client/core/modules/directory.js, line 310

# static updateGroup(groupId, update)

Update a group

Parameters:
Name Type Description
groupId string
update object

View Source client/core/modules/directory.js, line 279

# static updateUser(userId, update)

Update a user

Parameters:
Name Type Description
userId string
update object

View Source client/core/modules/directory.js, line 248