remove_user_from_group()
Removes a user from a group.
Deletes the matching row from the database table bgrel.
To remove a user from all groups, prefer remove_user_from_all_groups() — it is more efficient.
1. Signature
-
Sync
-
Async
ecm.security.remove_user_from_group(user_guid: str, group_guid: str) -> None
ecm.security.remove_user_from_all_groups(user_guid: str) -> None
await ecm.security.remove_user_from_group(user_guid: str, group_guid: str) -> None
await ecm.security.remove_user_from_all_groups(user_guid: str) -> None
2. Parameters
| Parameter | Default | Description |
|---|---|---|
|
— |
GUID of the user. |
|
— |
GUID of the group (only |
5. Examples
5.1. Remove a single membership
-
Sync
-
Async
user = ecm.security.user("john")
group = ecm.security.group("AUDITORS")
assert user and group
ecm.security.remove_user_from_group(user.guid, group.guid)
user = await ecm.security.user("john")
group = await ecm.security.group("AUDITORS")
assert user and group
await ecm.security.remove_user_from_group(user.guid, group.guid)
6. See also
-
add_user_to_group() — Add association
-
user_groups() — Query memberships