Skip to content

userSecurity.groups ^v2.7.0

Provides an interface for managing security groups within the system. It allows operations such as creating, deleting, retrieving, and listing security groups.

Functions and Properties


  • create(name)

    Creates a new security group with the specified name.

    • Parameters:

      • name - The name of the group to be created.
    • Returns:

      • An instance of a Group interace representing the newly created group.

  • delete(name)

    Deletes a security group based on its name.

    • Parameters:

      • name - The name of the group to be deleted.
    • Returns:

      • true if the group was successfully deleted, otherwise false.

  • get(name)

    Retrieves a security group by its name.

    • Parameters:

      • name - The name of the group to retrieve.
    • Returns:

      • An instance of Group interface representing the group.

  • list()

    Lists all security groups in the system.

    • Returns:

      • An array containing all groups ids, names, and wether or not they can be edited or deleted.

Examples

js
// Create a new security group
var newGroup = userSecurity.groups.create("Example Group");
console.log(newGroup.getName());

// Delete a security group
var deletionSuccess = userSecurity.groups.delete("Example Group");
console.log(deletionSuccess ? "Group deleted successfully." : "Group deletion failed.");

// Retrieve a security group
var group = userSecurity.groups.get("Admin");
console.log(group.getName());

// List all security groups
var groups = userSecurity.groups.list();
console.log(groups);
// Create a new security group
var newGroup = userSecurity.groups.create("Example Group");
console.log(newGroup.getName());

// Delete a security group
var deletionSuccess = userSecurity.groups.delete("Example Group");
console.log(deletionSuccess ? "Group deleted successfully." : "Group deletion failed.");

// Retrieve a security group
var group = userSecurity.groups.get("Admin");
console.log(group.getName());

// List all security groups
var groups = userSecurity.groups.list();
console.log(groups);