groups()

Returns all groups defined on the server.

1. Signature

  • Sync

  • Async

ecm.security.groups() -> list[ECMGroup]
await ecm.security.groups() -> list[ECMGroup]

2. Return value

List of ECMGroup instances. Empty list when no groups exist.

2.1. ECMGroup fields

Field Type Description

id

int

Numeric group ID.

name

str

Name of the group.

guid

str

Globally unique identifier of the group.

profile_user_id

int

ID of the profile user assigned to the group. -1 if no profile user is assigned.

description

str

Optional description of the group.

3. Examples

3.1. List all groups

  • Sync

  • Async

groups = ecm.security.groups()
for group in groups:
    print(group.name, group.guid)
groups = await ecm.security.groups()
for group in groups:
    print(group.name, group.guid)

3.2. Find a group by name

  • Sync

  • Async

groups = ecm.security.groups()
admins = next((g for g in groups if g.name == "Administrators"), None)
groups = await ecm.security.groups()
admins = next((g for g in groups if g.name == "Administrators"), None)

4. See also