Kernlift

Users and accounts

Find an account, read what it holds, assign roles, ban and restore, and repair a credit balance.

On /admin/users/dashboard an operator looks up one account: what it bought, what it holds, and why it cannot sign in. The page is not a CRM. It has no free-text notes about a customer and shows only the rows the product wrote.

Before you begin

  • users.read to open the directory and a detail page, users.write to change a status, and roles.write to change which roles an account holds. See Roles and permissions.
  • The three permissions are separate so that you can grant them independently. Support staff usually need the first, rarely the second, and not the third.

Set it up

Open the directory

/admin/users/dashboard lists accounts with their status and roles. Search by name or e-mail.

Open one account

/admin/users/$userId shows the account's roles, its access profile status, its licences, its credit balance and its recent activity. These are the same rows the customer sees at /app, read from the same repositories.

Ban or restore

A banned account keeps its rows and loses its session. The guards reject it at the layout, so every /app and /admin page is blocked without a per-page check. Restoring the account lifts the ban. No data is deleted in between.

Repair a credit balance

If the ledger and the cached balance disagree, adminRepairUserCreditBalance({ userId }) recomputes the balance from the ledger entries. It is the button on the detail page and requires credits.write. Users cannot call it, and no self-service path writes a balance.

Account status

Prop

Type

Authorization is enforced in users-rbac.ts by each server operation through requireAdminPermission. Being able to see the page does not grant permission to act.

Verify

  1. Open /admin/users/dashboard with a role that has only users.read. The list renders and the ban action is rejected.
  2. Ban an account, then try to open /app as that account. The layout rejects it, so no /app page opens.
  3. Restore it. The same account signs in again with its licences and credits intact.
  4. Add a role to an account and reload its detail page. The permission list is the union of its roles.

Reference

Next steps