mr user update
Update an existing user account. Only the flags you pass are sent and changed; omitted fields are preserved by the server. Use --disabled to lock an account and --enable to unlock it; disabling an account or setting a new password revokes its sessions and API tokens. --disabled and --enable cannot be combined. Passwords must be at least 8 characters and at most 72 bytes. Demoting or disabling the last enabled administrator is refused with HTTP 409 Conflict, so an instance can never be left without an admin.
Usage
mr user update <id>
Positional arguments:
<id>
Examples
Promote user 4 to editor
mr user update 4 --role editor
Disable an account and reset its password
mr user update 4 --disabled --password password2
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--username | string | `` | New username |
--password | string | `` | New password (omit to keep the current one; setting one revokes the account's sessions and tokens) |
--role | string | `` | New role: admin, editor, user, or guest |
--display-name | string | `` | New display name |
--scope-group | uint | 0 | New scope group id (use 0 to clear) |
--disabled | bool | false | Disable the account (revokes its sessions and tokens) |
--enable | bool | false | Re-enable a disabled account |
Inherited global flags
| Flag | Type | Default | Description |
|---|---|---|---|
--json | bool | false | Output raw JSON |
--no-header | bool | false | Omit table headers |
--page | int | 1 | Page number for list commands (default page size: 50) |
--quiet | bool | false | Only output IDs |
--server | string | http://localhost:8181 | mahresources server URL (env: MAHRESOURCES_URL) |
Exit Codes
0 success; 1 error (not authenticated, insufficient role, validation error, or user not found)