Skip to content

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.

    • Parameters:

      • email - The email address of the user to retrieve.
    • Returns:

      • An instance of User interface representing the user.

  • get(userId)

    Retrieves a user by their unique identifier.

    • Parameters:

      • userId - The identifier of the user, either numeric ID or string.
    • Returns:

      • An instance of User interface representing the user.

  • getCurrent()

    Retrieves the user running the process.

    • Returns:

      • An instance of User interface representing the current user running the process.

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());