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.
delete(name)
Deletes a security group based on its name.
get(name)
Retrieves a security group by its name.
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);