# XWUISuperAdmin

The administration console for a multi-tenant product. It covers the full estate of
administrative objects in one list: `organization`, `workspace`, `member`, `team`, `role`,
`policy`, `session`, `api-key`, `audit-entry` and `setting`.

## When to use

- The settings / admin area of a SaaS product, where an operator manages tenants and people.
- Destructive administration (revoke a session, delete an API key) that must be confirmed and
  capability-gated.
- An audit trail that has to be readable next to the objects it describes.

This is the hub where the fail-closed authorization rule earns its keep: give every destructive
action a `capability`, pass a real `config.context`, and an unauthorized operator is denied with
`XWUI_SUPER_ACTION_DENIED` instead of being handed the action.

## Configuration surface

The constructor is `new XWUISuperAdmin(container, data, config)`. `data` is the state
you already hold; `config` is how the hub talks to your backend.

`config.provider` is the only integration point that matters:

- `list(query, signal)` -> `{ items, total?, nextCursor? }`. `query` carries
  `text`, `sectionId`, `cursor`, `limit` and `sort`; honour `signal`, because
  every new search, section switch or refresh aborts the in-flight request.
- `execute(request)` -> `{ message?, items?, refresh? }`, required by any entry
  in `config.actions`. An action with no `execute` fails with
  `XWUI_SUPER_ACTION_PROVIDER_REQUIRED` rather than silently doing nothing.
- `subscribe(listener)` is optional; when present the hub reloads on every
  push and unsubscribes on destroy.

The rest of `config`: `title` / `subtitle` / `className` for chrome;
`columns` (each `key` indexes the row built from the item's own fields plus its
`values` bag, so a custom column needs a matching `values` entry); `actions`
scoped `global` | `selection` | `item`, optionally `requiresConfirmation` and
`capability`; `confirmAction(action, items)` to gate confirmations (without it
a confirming action only emits `confirmationRequired`); `mountDetail` to own
the detail pane; `context` for the `XWUISuperContext` that authorizes
capabilities; plus `searchable`, `selectable`, `selectionMode`
(`single` | `multiple`), `autoLoad` (default true, loads on connect when a
provider exists), `refreshAfterAction` (default true), `pageSize` (default 50),
`density` (`compact` | `comfortable` | `spacious`) and a `labels` bag for every
piece of built-in copy.

Authorization is fail-closed: an action carrying a `capability` with no
`config.context` authorizer is **denied**, not allowed. Leave `capability` off
actions that genuinely need no permission.

`data` seeds and mirrors the view: `items`, `sections` (the tab strip),
`metrics` (the tile row), `query`, `activeSectionId`, `activeItemId`,
`selectedIds`, `loading`, `loadingMore`, `actionPendingId`, `error`, `total`,
`nextCursor` and `lastActionMessage`. Omit `columns` and the table falls back to
Title / Status / Updated.

## Administration

Organizations, workspaces, identities, teams, roles, policies, sessions, keys, audits, and settings.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Administration
description: Organizations, workspaces, identities, teams, roles, policies, sessions, keys, audits, and settings.
```

```api
```
