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:
co-authored by
Claude Fable 5.2
parent
20809ba933
commit
a19fa0d17b
+15
-2
@@ -355,6 +355,18 @@ is kept and can only narrow it. To keep a late collection's rules exactly as the
|
||||
wider `read` — say so on the collection: `custom: { ipal: { accountRules: false } }` (the password rule and the
|
||||
first-user endpoint still apply), or list that plugin before ipalKit.
|
||||
|
||||
**A collection of your own config that becomes staff later** — it is in the config, you did not name it as staff,
|
||||
and a plugin listed after ipalKit sets `admin.user` to it — is handled at the same moment, with one difference:
|
||||
the plugin saw it at config time and wrote down which operations had a rule of yours (the marker's `own`). **Those
|
||||
rules stay exactly as written; an operation that had no rule gets the plugin's** — the same result as for a
|
||||
collection named in `access.staffCollections`, and its `roles` field is guarded where the plugin's `update` rule
|
||||
is the one in force. The log: `[ipal] "people" became a staff collection after ipalKit ran: put on it — access
|
||||
rules for update, delete, unlock, read, readVersions, roles; the password rule. Its own rules for create are kept
|
||||
as written.` Without rules of its own such a collection ran on Payload's defaults before (any signed-in account,
|
||||
a customer included, created and changed panel accounts). Simpler and clearer: name the collection in
|
||||
`access.staffCollections`, or list that plugin before ipalKit. Verify: sign in as an account of a non-staff
|
||||
collection and `POST /api/<slug>` — 403 unless your own `create` rule lets it through.
|
||||
|
||||
**A copy of a staff collection** — a later plugin that spreads one into a new slug (`{ ...staff, slug: 'copy' }`),
|
||||
or a new collection that reuses a staff collection's `access` object — brings along rules the plugin wrote for
|
||||
the ORIGINAL: "an account of `staff`", "the account itself" = one of the original's. The plugin sees them by a
|
||||
@@ -387,8 +399,9 @@ import { adminOrSelfIn } from '@intecion/ipal-kit'
|
||||
|
||||
A rule you write there is not marked, so on a staff copy it is combined with the plugin's rule for `copy`
|
||||
("an admin, or the account itself" of the copy) and works. The password rule is on a copy once
|
||||
(`isPasswordRuleHook`). The marker `custom.ipalAccounts` (`{ slug, staff }`, type `AccountsMarker`) records which
|
||||
collection the plugin has handled and whether as staff: a copy carries the original's marker and is handled under
|
||||
(`isPasswordRuleHook`). The marker `custom.ipalAccounts` (`{ slug, staff, own? }`, type `AccountsMarker`) records which
|
||||
collection the plugin has handled, whether as staff, and — for a collection that was not staff at config time —
|
||||
which operations had a rule of the project's then (`own`): a copy carries the original's marker and is handled under
|
||||
its own slug; in `next dev` a collection named as staff in an edit is handled on the reload. A marker for the
|
||||
collection's own slug means "handled" — only your own config can write one, like `accountRules: false`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user