Skip to content

Commit 845325d

Browse files
committed
chore(changeset): patch for the file-field projection without id
Claude-Session: https://claude.ai/code/session_01FEkQ5nso8iiU7cfQSEAkX5 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8c3fdf3 commit 845325d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
fix(objectql): a file field reads the same whether or not the projection lists `id`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A reader who may not read `sys_file` (every member whose application grants no `sys_file` read) is served a file field by the verdict of the record that owns the file, matched on that record's `id`. A read whose projection left `id` out, such as `GET /api/v1/data/OBJECT?select=FILE_FIELD`, gave that verdict no record key, so a file the reader may read came back as `{ id, metadataRefused: true }`, while `select=id,FILE_FIELD` answered the full `{ id, name, size, mimeType, url }`.
11+
12+
`find` and `findOne` now read `id` for any projection that names a file field and cut it back off the answer, the same way a formula's widened columns are cut. So:
13+
14+
- A permitted reader gets the full file value with or without `id` in `select` / `fields`, on `GET /data/:object`, `POST /data/:object/query` and `GET /data/:object/:id`.
15+
- The answer still carries exactly the columns the caller named: no `id` is added to a row that did not ask for it.
16+
- A reader the owning record's verdict refuses is still answered `{ id, metadataRefused: true }`, with or without `id`.

0 commit comments

Comments
 (0)