Set Roles¶
The admin users set-roles command adds or removes roles for a user. Requires admin role or higher. Superadmin accounts cannot be modified by non-superadmin users. Non-superadmin users cannot assign the superadmin role.
Role names can be provided in short form (e.g., admin) and will be automatically prefixed.
Note
Sessions are invalidated after role changes. The affected user will need to log in again.
Parameters¶
| Parameter | Description |
|---|---|
KC_ID |
Keycloak user ID (required, positional). |
--add, -a |
Comma-separated roles to add. |
--remove, -r |
Comma-separated roles to remove. |
🖥️ Basic Usage¶
Usage: easytask admin users set-roles [OPTIONS] KC_ID
Add or remove roles for a user.
╭─ Arguments ─────────────────────────────────────────────────────────────────╮
│ * kc_id TEXT Keycloak user ID [required] │
╰─────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────╮
│ --add -a TEXT Comma-separated roles to add │
│ --remove -r TEXT Comma-separated roles to remove │
│ --help -h Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────╯