readPublished on version history: readPublishedVersions, and the documented form works (1.17.2)
readVersions: readPublished(), as access.md showed, answered every version read with 500 on MongoDB, Postgres and SQLite: the rule returns the document's `_status` path, a version query runs on the versions collection where the status is `version._status` (SQL: "Cannot find field for path at _status"; MongoDB: TypeError in sanitizeQueryValue). Reported by a client project upgrading to 1.17.1. - readPublishedVersions(minimum): the version form, for readVersions. - readPublished() carries a symbol mark (READ_PUBLISHED); iapl() swaps it on readVersions of the collections and globals it sees (withVersionReadRules, exported for plugins listed after it). - Tests on the three adapters: the version list (REST, depth 0/2, Local API, GraphQL), one version by id, the count, a global, an explicit role; the 1.17.1 HTTP test now checks the status too. - access.md says where each rule goes; AGENT.md, iapl-collection and iapl-audit skills. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
fc70a34f3e
commit
4b17254135
@@ -78,7 +78,8 @@ names, env, admin, AGENTS.md, skills, seeds and — with `--url` / `--deep` —
|
||||
|
||||
- **Drafts and locales over the API** (a collection with `versions: { drafts: true }`): without a session,
|
||||
`curl -s "$U/api/<slug>?draft=true&limit=100" | grep -c '"_status":"draft"'` → `0`, else ERROR: give it
|
||||
`access: { read: readPublished(), readVersions: readPublished() }` (access.md). `curl -sI "$U/md/xx"` → `404`
|
||||
`access: { read: readPublished(), readVersions: readPublishedVersions() }` (access.md). `curl -s -o /dev/null -w '%{http_code}' "$U/api/<slug>/versions?limit=10"`
|
||||
→ `200` (a `500` = a rule with the document's `_status` path on `readVersions`: ERROR). `curl -sI "$U/md/xx"` → `404`
|
||||
(no stand-in locale); a 404 page assigned in System pages must be published.
|
||||
- **Secrets out of queries** (as an admin, with versions on for Site integrations or a collection using
|
||||
`writeOnlySecret`): `curl -s -H "Authorization: JWT $T" "$U/api/globals/site-integrations/versions?where[version.smtpPassword][exists]=true"`
|
||||
|
||||
@@ -46,9 +46,11 @@ Ask only when the brief leaves a business question open (e.g. "do posts have aut
|
||||
**No URL prefix in code** — the editor assigns the archive page in
|
||||
Site settings (`<slug>Archive`). The plugin handles routing, sitemap,
|
||||
generateStaticParams, hreflang.
|
||||
**With drafts** (`versions: { drafts: true }`): `access: { read: readPublished(), readVersions: readPublished() }`
|
||||
**With drafts** (`versions: { drafts: true }`): `access: { read: readPublished(), readVersions: readPublishedVersions() }`
|
||||
(`readPublished` is for `read`, `readPublishedVersions` for `readVersions` — the version list asks for `version._status`)
|
||||
— Payload's open `read: () => true` answers `?draft=true` with the draft over REST and GraphQL. Check:
|
||||
`curl -i <site>/api/<slug>/<draft id>?draft=true` without a session → `404`; the same with an editor's token → the draft.
|
||||
`curl -i <site>/api/<slug>/<draft id>?draft=true` without a session → `404`; the same with an editor's token → the draft;
|
||||
`curl -s -o /dev/null -w '%{http_code}' <site>/api/<slug>/versions?limit=10` without a session → `200`, never `500`.
|
||||
3. Entry list = a block (EntriesList) with `getEntries`; the entry page uses
|
||||
`resolveRoute` (type `entry`); JSON-LD per seo.md (e.g. Article).
|
||||
4. **An auth collection for visitors** (`auth: true`: customers, members) only when the client requires it
|
||||
|
||||
Reference in New Issue
Block a user