Roles
RolesEditor
Role creation and edit form with permission assignment for admin roles management.
RolesEditor
Renders a form for creating or editing a role with name, description, and a permissions checklist grouped by resource (users, content, billing, etc.).
Components
<XAdminRolesEditor />
Displays a role configuration form with a grouped, searchable permissions checklist and save/cancel controls.
<XAdminRolesEditor :roleId="roleId" />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
roleId | string | undefined | ID of the role to edit; omit for a new role |
endpoint | string | '/api/admin/roles' | Base API endpoint |
loading | boolean | false | Show loading skeleton |
permissions | Permission[] | undefined | Available permissions to assign (fetched if not provided) |
groupByResource | boolean | true | Group permissions by resource category |
Types
interface Permission {
id: string
name: string
resource: string
description?: string
}
AI Context
component: XAdminRolesEditor
package: "@xenterprises/nuxt-x-app-admin"
category: Roles
use-when: Creating or editing a role and assigning permissions to it in an admin roles management section
