X Enterprises
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

PropTypeDefaultDescription
roleIdstringundefinedID of the role to edit; omit for a new role
endpointstring'/api/admin/roles'Base API endpoint
loadingbooleanfalseShow loading skeleton
permissionsPermission[]undefinedAvailable permissions to assign (fetched if not provided)
groupByResourcebooleantrueGroup 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
Copyright © 2026