Directory to handle users and groups
Methods
# static deleteApiClient(clientId)
Delete an API client
Parameters:
Name | Type | Description |
---|---|---|
clientId |
string
|
# static editUsername(userId)
Dialog to change the user first name and last name
Parameters:
Name | Type | Description |
---|---|---|
userId |
string
|
# 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 |
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
|
# static getEntryColor(userId) → {string}
Get the entry color (randomly assigned at startup)
Parameters:
Name | Type | Description |
---|---|---|
userId |
string
|
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
|
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 |
Array of entry names
Array.<string>
# static getGroups(sortOrder) → {Array.<object>}
Get groups
Parameters:
Name | Type | Description |
---|---|---|
sortOrder |
string
|
"asc" (default) | "desc" |
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
|
Array.<string>
# static getUserInitials(user) → {string}
Get the user initials
Parameters:
Name | Type | Description |
---|---|---|
user |
object
|
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 |
Array of users
Array.<object>
# static init() → {Promise.<boolean>}
Init the address book
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
|
# static updateGroup(groupId, update)
Update a group
Parameters:
Name | Type | Description |
---|---|---|
groupId |
string
|
|
update |
object
|
# static updateUser(userId, update)
Update a user
Parameters:
Name | Type | Description |
---|---|---|
userId |
string
|
|
update |
object
|