AdminUserEditPanel
Admin user-edit panel. Surfaces the slice of admin operations a back-office user-management page needs:
- Role assignment — toggle a curated list of role codes; calls
PUT /admin/users/{id}/roles. - Set password — admin can reset without the user’s current
password; calls
POST /auth/admin/set-password. - Hard-delete — calls
DELETE /admin/users/{id}/hard(system_admin only on the server; we gate the button oncurrentUserIsSystemAdmin).
Composes the UserAvatar atom for visual identity. Caller-gated:
always wrap this in <RoleGate anyOf={['system_admin','super_admin']}>
upstream — the server enforces but a gate prevents the UI from showing
up at all for non-admins.
Usage
import { AdminUserEditPanel } from '@rw3iss/auth-client/preact/forms';
<AdminUserEditPanel user={/* LookupUserRecord */}/>Props
| Name | Type | Description |
|---|---|---|
user | LookupUserRecord | (required) |
client | AuthClient | |
assignableRoles | string[] | Role codes the admin can toggle. Default: a reasonable subset. |
currentRoles | string[] | Currently-assigned role codes. |
currentUserIsSystemAdmin | boolean | Whether the caller is system_admin — gates the hard-delete affordance. |
onSaved | () => void | Fired after a successful save action (any of roles / password). |
onDeleted | () => void | Fired after a successful hard-delete; consumer navigates away. |
className | string |