@@ -1733,19 +1733,28 @@ export const FieldSchema = lazySchema(() => {
17331733 * Declared per referencing field by the application author, never on the
17341734 * target object: the application decides whose names its own pages reveal.
17351735 * `true` declares that a principal who can read the record carrying this
1736- * field MAY see, for the record this field points at, its display name (the
1737- * target object's `nameField` value, ADR-0079) and its id, even when that
1738- * principal cannot read the target record. Nothing else of the target:
1736+ * field MAY see, for the record this field points at, its display name and
1737+ * its id, even when that principal cannot read the target record. The name
1738+ * is the ADR-0079 D4 display name `resolveRecordDisplayName` answers: the
1739+ * target object's `nameField`, else its `displayNameField`, else the derived
1740+ * title field. The served value is `ReferenceNameOnlyValueSchema`
1741+ * (`field-value.zod.ts`). Nothing else of the target:
17391742 * `$expand` on this field MUST return the same name and id only, the field's
17401743 * own `displayField` MUST NOT widen what is shown, and the renderer shows the
17411744 * name as text with no link to the target record. A principal who can read
17421745 * the target is served exactly what it is served without the key.
17431746 *
17441747 * The key lifts the RECORD-level refusal only. A field-level rule on the
1745- * name field itself still holds: when the reader's field-level security
1746- * keeps that field from it, the field declares a `maskingRule`, or it is a
1747- * formula reading through another reference, the name served is the
1748- * ADR-0079 floor (`Record #` and the id).
1748+ * name field itself still holds, and the engine reads that field only where
1749+ * it computes nothing the security layer owns. The name served is the
1750+ * ADR-0079 floor (`Record #` and the id) in five cases (objectql's
1751+ * `servableNameField`): the reader's field-level security keeps
1752+ * that field from it; the field declares a `maskingRule`; it is a formula
1753+ * reading through another reference; an explicit `nameField` (or
1754+ * `displayNameField`) points at a column that is neither title-typed nor
1755+ * `autonumber`; or no field-level answer can be had for the reader. A
1756+ * target with no resolvable or no non-empty name reads as the same floor,
1757+ * as it does for every reader.
17491758 *
17501759 * Absent or `false` keeps the restricted-reference posture: a lookup whose
17511760 * target the reader cannot read shows no name. Valid on `lookup` and on
@@ -1755,14 +1764,18 @@ export const FieldSchema = lazySchema(() => {
17551764 referenceNameVisible : z . boolean ( ) . optional ( ) . describe (
17561765 'Declared name exposure (`lookup` and `user` fields only). TRUE declares that a principal who can '
17571766 + 'read the record carrying this field may see the referenced record\'s display name (the target '
1758- + 'object\'s `nameField` value) and id even when that principal cannot read the referenced record. '
1759- + 'Served on `$expand`: a target the reader is refused (the object\'s read gate or its row scope) '
1760- + 'answers `{ id, name, readRefused: true }`, per element on a multi-value field; an unexpanded read '
1767+ + 'object\'s `nameField`, else its `displayNameField`, else the derived title field) and id even when '
1768+ + 'that principal cannot read the referenced record. Served on `$expand`: a target the reader is refused '
1769+ + '(the object\'s read gate or its row scope) answers `{ id, name, readRefused: true }` '
1770+ + '(`ReferenceNameOnlyValueSchema`), per element on a multi-value field; an unexpanded read '
17611771 + 'answers the stored id, as for every reader. Nothing else of the target: `$expand` on this field '
17621772 + 'returns the same name and id only, the field\'s `displayField` does not widen it, and the name '
1763- + 'renders as text with no link to the target. A field-level rule on the name field still holds: '
1764- + 'when the reader may not read that field, it is masked, or it is a formula reading through another '
1765- + 'reference, the name is the `Record #` floor with the id. A principal who can read the target is '
1773+ + 'renders as text with no link to the target. A field-level rule on the name field still holds, and '
1774+ + 'the name field is read only where nothing the security layer owns must be computed: the name is the '
1775+ + '`Record #` floor with the id when the reader may not read that field, it declares a `maskingRule`, '
1776+ + 'it is a formula reading through another reference, an explicit `nameField` points at a column that '
1777+ + 'is neither title-typed nor autonumber, or no field-level answer can be had for the reader. A target '
1778+ + 'with no resolvable or no non-empty name reads as the same floor. A principal who can read the target is '
17661779 + 'served exactly what it is served without the key. Absent or false keeps the restricted-reference '
17671780 + 'posture for a target the reader cannot read. Declared on the referencing field only; there is no '
17681781 + 'target-object switch. Refused on any other type.'
0 commit comments