delete_user()
Deletes a user from the database table benutzer.
Group associations (bgrel), system roles (ossysroles), subscriptions (osabonnement) and personal settings (osconf) are removed alongside.
Portfolios and mailbox content can optionally be forwarded to another user.
1. Signature
-
Sync
-
Async
ecm.security.delete_user(
user_guid: str,
*,
target_user_guid: str | None = None,
forward_portfolios: bool = False,
forward_mails: bool = False,
) -> None
await ecm.security.delete_user(...) -> None
2. Parameters
| Parameter | Default | Description |
|---|---|---|
|
— |
GUID of the user to delete. |
|
|
GUID of the recipient who inherits portfolios / mails. Effectively required by the server even when nothing is forwarded — the empty string is rejected (error |
|
|
Forward the user’s portfolios instead of deleting them. |
|
|
Forward the user’s mailbox instead of deleting it. |
4. Errors
-
ValueError— whenforward_*is set withouttarget_user_guid. -
ECMException(or subclass) on server failures.
5. Examples
5.1. Fully delete an account
target_user_guid is required by the server on v12. Pragmatically, pass the connected admin user as target.
|
-
Sync
-
Async
admin = ecm.security.user("root")
ecm.security.delete_user(user.guid, target_user_guid=admin.guid)
admin = await ecm.security.user("root")
await ecm.security.delete_user(user.guid, target_user_guid=admin.guid)
6. See also
-
create_user() — Create account
-
update_user() — Modify attributes