userSecurity.users ^v2.7.0
Provides an interface for managing user accounts within the system, facilitating operations such as retrieving, updating, and managing user details and their security groups.
Functions and Properties
getFromEmail(email)
Retrieves a user based on their email address.
get(userId)
Retrieves a user by their unique identifier.
getCurrent()
Retrieves the user running the process.
Returns:
- An instance of
User
interface representing the current user running the process.
- An instance of
Examples
js
// Retrieve a user by email
var userByEmail = userSecurity.users.getFromEmail("john.doe@example.com");
console.log("User Retrieved: " + userByEmail.getName());
// Retrieve a user by ID
var userById = userSecurity.users.get(123);
console.log("User Retrieved: " + userById.getName());
// Retrieve the currently logged-in user
var currentUser = userSecurity.users.getCurrent();
console.log("Current User: " + currentUser.getName());
// Retrieve a user by email
var userByEmail = userSecurity.users.getFromEmail("john.doe@example.com");
console.log("User Retrieved: " + userByEmail.getName());
// Retrieve a user by ID
var userById = userSecurity.users.get(123);
console.log("User Retrieved: " + userById.getName());
// Retrieve the currently logged-in user
var currentUser = userSecurity.users.getCurrent();
console.log("Current User: " + currentUser.getName());