L-1 and one changelog entry for the release: what gets narrower on a copy, the collection that becomes staff later

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 10:03:31 +01:00
co-authored by Claude Fable 5.2
parent 20809ba933
commit a19fa0d17b
10 changed files with 96 additions and 56 deletions
@@ -110,6 +110,7 @@ through this procedure. Ask only when you are missing something you cannot get y
| an account saves its own profile and its `roles` do not change (no error) | `accounts.adminOnlyWrite`: nobody changes its own roles; with the plugin's roles only an admin changes roles | an admin changes the role; or give the `roles` field its own `access.update` |
| a logged-in visitor (customer) gets `403` reading a staff collection — an author box went empty | `accounts.staffOnlyRead`: only staff accounts read a staff collection without a `read` rule | write that collection's `read` rule; or `staffOnlyRead: false` |
| `/api/health` answers 503, the panel and `/api/*` 500 after a deploy; log: `[ipal] access names "…" as a staff collection, but this config has no auth collection with that slug` | a slug in `access.staffCollections` / `access.authCollection` is not an auth collection (a typo, a removed collection): Payload does not start, the process stays up (with a health check Coolify keeps the old container) | fix the slug or add the collection |
| the log says `"<slug>" became a staff collection after ipalKit ran` | a plugin listed after ipalKit set `admin.user` to a collection of your config that is not named as staff: the operations without a rule of yours got the plugin's, yours are kept (named in the same line) | name the collection in `access.staffCollections` (or `access.authCollection`), or list that plugin before ipalKit |
| a collection added by a plugin listed after ipalKit refuses what its own access rule allows | it is in `access.staffCollections`: the plugin's account rules are put in front of its rules and both must allow (the log at start lists what was put) | `custom: { ipal: { accountRules: false } }` on that collection, or list that plugin before ipalKit |
| a fresh site with `access.firstUserAdmin: false`: the first account sees "Unauthorized", or the start fails with `leaves a fresh site with nobody who can open the panel` | the first account gets the default role, below the panel role | `access.defaultRole: 'editor'`, or `accounts: { panelRole: false }`, or drop `firstUserAdmin: false` |
| saving Site integrations fails on the password field: "Enter the password again…" | the server, port or user name changed and the stored SMTP password is kept only for the settings it was saved with — also when the transport says Microsoft Graph | type the password again; or "Remove the stored value" for a server without one; a seed with the Local API is not asked; `secrets: { reenterOnChange: false }` |
@@ -82,7 +82,7 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
| `buildRolesField(defaultRole?, { firstUserAdmin? })` | `@intecion/ipal-kit` | The `roles` select field the plugin injects (only admins set roles; `firstUserAdmin` default `true` = the account made on "Create first user" gets `admin`). The plugin wires it itself — use it only for an auth collection the plugin does not manage. |
| `injectRoles(config, accessOption)` | `@intecion/ipal-kit` | Adds `roles` to `accessOption.authCollection` in a config. The plugin calls it itself with `access` — do not call. |
**Types:** `AccountsOptions` (`accounts`: `panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, `staffOnlyRead`, `firstUserRoute`, `password`), `StaffAccountAccessOptions` (`{ create?, write?, read?, pluginRoles? }`), `StaffRuleMark` (`{ slug, self }`), `AccountsMarker` (`{ slug, staff }`, in `custom.ipalAccounts`), `LateAdoption` (`{ slug, applied, password, firstUser }`), `StaffAccountRules` (what the plugin put on a staff collection, in `custom.ipalAccountRules`: `{ applied, ownRoles }`), `WriteOnlySecretOptions` (`{ boundTo?, appliesWhen? }`), `PasswordRuleOptions` (`{ minLength? }`), `FirstUserRouteOption` (`'panel' \| 'all' \| string[]`), `TurnstileOnConfigError` / `TurnstileOnConfigErrorOption` / `TurnstileFormKind` (`@intecion/ipal-kit/server`), `VerifyLimitOptions` (`twoFactor.verifyLimit`: `{ max?, windowMinutes?, store? }`), `RequireSetupOptions` (`twoFactor.requireSetup`), `TwoFactorResetOptions`, `TwoFactorSetupState`, `SafeBackRule` / `SafeBackContext` (`twoFactor.safeBack` as a function: `(back, { adminRoute, origin? }) => string`), `TotpViewComponent` (a view component as registered: a path or `{ path, exportName?, clientProps?, serverProps? }`), `SafeTotpViewProps` (`@intecion/ipal-kit/admin`), `Role` (`'user' \| 'editor' \| 'admin'`), `AccessOption` (the plugin's `access` option: `authCollection`, `defaultRole`, `authAccess`, `firstUserAdmin`, `staffCollections`).
**Types:** `AccountsOptions` (`accounts`: `panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, `staffOnlyRead`, `firstUserRoute`, `password`), `StaffAccountAccessOptions` (`{ create?, write?, read?, pluginRoles? }`), `StaffRuleMark` (`{ slug, self }`), `AccountsMarker` (`{ slug, staff, own? }`, in `custom.ipalAccounts`; `own`: the operations that had a rule of the project's at config time, kept when the collection becomes staff later), `LateAdoption` (`{ slug, applied, kept, known, password, firstUser }`; `known`: in the config when ipalKit ran and staff only afterwards, `kept`: its operations whose own rule was left as written), `StaffAccountRules` (what the plugin put on a staff collection, in `custom.ipalAccountRules`: `{ applied, ownRoles }`), `WriteOnlySecretOptions` (`{ boundTo?, appliesWhen? }`), `PasswordRuleOptions` (`{ minLength? }`), `FirstUserRouteOption` (`'panel' \| 'all' \| string[]`), `TurnstileOnConfigError` / `TurnstileOnConfigErrorOption` / `TurnstileFormKind` (`@intecion/ipal-kit/server`), `VerifyLimitOptions` (`twoFactor.verifyLimit`: `{ max?, windowMinutes?, store? }`), `RequireSetupOptions` (`twoFactor.requireSetup`), `TwoFactorResetOptions`, `TwoFactorSetupState`, `SafeBackRule` / `SafeBackContext` (`twoFactor.safeBack` as a function: `(back, { adminRoute, origin? }) => string`), `TotpViewComponent` (a view component as registered: a path or `{ path, exportName?, clientProps?, serverProps? }`), `SafeTotpViewProps` (`@intecion/ipal-kit/admin`), `Role` (`'user' \| 'editor' \| 'admin'`), `AccessOption` (the plugin's `access` option: `authCollection`, `defaultRole`, `authAccess`, `firstUserAdmin`, `staffCollections`).
## Accessibility — widget (`accessibility`) — details: `node_modules/@intecion/ipal-kit/docs/accessibility.md`
+3 -1
View File
@@ -259,7 +259,9 @@ the panel shows Site settings, Site integrations, Cookies, Form messages, the Fo
one each of its accounts is an admin to the plugin. Every slug in `access.staffCollections` must be an auth
collection of the config, or Payload does not start (`/api/health` 503, the slug in the log); a staff collection
from a plugin listed after ipalKit gets the rules in front of its own (`custom: { ipal: { accountRules: false } }`
on it keeps its own as they are); Payload's first-user route answers only for the
on it keeps its own as they are); a collection of the config that a later plugin makes the panel's (`admin.user`)
keeps the rules you wrote and gets the plugin's for the rest — name the login collection in
`access.staffCollections` so it is handled at config time; Payload's first-user route answers only for the
panel's login collection (`firstUserRoute`) — so **create the first account right after the first deploy**, it
becomes the admin; a new password has at least 12 characters (`password`). A customer collection with
sign-up: write its own `create: () => true`; the rules do not touch it. Do not combine
@@ -477,6 +477,12 @@ account → "Two-step verification: Set up." and the reset button; delete the ac
A staff collection added by a plugin listed after ipalKit gets the same rules at start, put in FRONT of the
rules it has (both must allow). If that plugin's collection needs a rule wider than the plugin's default,
set `custom: { ipal: { accountRules: false } }` on it.
From the release after 1.16.7: a **copy** of a staff collection made by such a plugin (`{ ...staff, slug: 'copy' }`)
gets the plugin's rule for its own slug in front of the copied rules — the copy's accounts edit themselves only
after `access: { ...staff.access, update: adminOrSelfIn('copy') }`, and the original's accounts no longer manage
the copy's. A collection of your config that such a plugin makes the panel's (`admin.user`) keeps the rules you
wrote and gets the plugin's for the operations without one — name it in `access.staffCollections` instead
(docs/access.md "Account rules"; the start log says what was put and what was kept).
`first-register` on any auth collection other than the panel's login collection answers `403` unless that
collection allows sign-up. `access.firstUserAdmin: false` with a default role below `editor`: the panel role
is not applied (a warning at start), or — with `accounts.panelRole` set — the start fails with the fix in the