Application Users ^v2.7.212
Returns the application users object from security.application.
Application Users Object
Methods
get(userIdOrEmail)Returns a User object assigned to the application, or
nullif the user is not assigned.userIdOrEmail(string): The user id or email address.
list()Returns an array of User objects assigned to the application.
exists(userIdOrUserOrEmail)Returns
trueif a user is assigned to the application, otherwisefalse.userIdOrUserOrEmail(number | string | object): The user id, email address, or User object.
add(userIdOrUserOrEmail)Adds a user to the application and returns
trueif the user was added, otherwisefalse.userIdOrUserOrEmail(number | string | object): The user id, email address, or User object.
remove(userIdOrUserOrEmail)Removes a user from the application and returns
trueif the user was removed, otherwisefalse.userIdOrUserOrEmail(number | string | object): The user id, email address, or User object.
removeAll()Removes all users from the application.
Returned Object
The users object returns the same User object documented under userSecurity.users.
Examples
js
var app = security.application("My Application");
var appUsers = app.users;
var currentUser = userSecurity.users.getCurrent();
console.log(`App contains current user: ${appUsers.exists(currentUser)}`);