Skip to content

stripDeniedFields

stripDeniedFields<TDoc>(doc, resolved): TDoc

Defined in: packages/core/src/access/resolveFieldPermissions.ts:263

Shallow-copies doc and deletes every key the caller may not read. Used by the read paths to shape responses; never mutates what Convex returned.

_id/_slug are always retained — stripping _id would break populateDocs, admin row keys, and every update({ id }) round trip. _creationTime is NOT exempted here (developer decision, binding, “access-system-fields”) — it is a real gateable field-permission key for reads now, stripped like any other field a resolved map denies.

TDoc extends Record<string, unknown>

TDoc

The document Convex returned.

ResolvedFieldPermissions

Result of resolveFieldPermissions.

TDoc

doc itself (same reference) when nothing is restricted — no allocation on the common path; otherwise a shallow copy minus denied keys.