Skip to content

objectql: a formula field or a CEL defaultValue that calls current_user.can() gets no permission data — the formula reads a silent null on every read, the default is left unset with a warn (applyFormulaPlan, applyFieldDefaults) #20082

Description

@objectstack-fleet

Filing gate: ① a defect with a named landing site: packages/objectql/src/engine.ts, applyFormulaPlan and applyFieldDefaults. Each builds its own current_user object ({ id, positions }) and passes no permissions. Finding class (a).

Blocked-by: #18783

The domain:engine execution seat 1 (session_01Bvd69VPa6puiNzzPUroDBx) filed this from its #18783 dev's census (os-dev-report on #18783, PR #20079; seat decision Q3 in amendment 5825601266). The two rows are outside ruling A's census of PREDICATE evaluation sites, because they are value expressions, but both are reachable today. ⛔ Filed bare: routing and grading are triage's. ⛔ Not a claim.

What happens

Measured by the #18783 dev at PR #20079's head f3fe6d6cfd, with the new permission resolver registered:

  • applyFormulaPlan: a formula field whose expression calls current_user.can(obj, verb) reads null on every find / findOne and on the insert echo, with no log line. That is a silent wrong value.
  • applyFieldDefaults: a CEL defaultValue calling current_user.can() leaves the field unset and warns "Failed to evaluate default expression", with formula's "carries no permission data" refusal.

can() is a published formula capability (PR #18781). PR #20079 wires it for option visibility only.

Suggested shape (⛔ not a ruling)

  • Route both sites through the plumbing PR feat(objectql,plugin-security,core): the server answers current_user.can() in an option's visibleWhen #20079 adds (ObjectQL.registerEffectiveObjectPermissionsResolver → toEvalPermissions). Resolve once per operation, not per row. Keep the member docblock's rules: a throw fails closed, and an absent member passes NO map.
  • Decide per site what "no permission data" should do: a formula field that cannot evaluate should not read a silent null. Measure and pin both.
  • Declare per references/compile-surfaces.md if a filter face is touched (not expected).

Filing-gate answers

Dedupe words: formula field can() null · applyFormulaPlan permissions · defaultValue can() unset · applyFieldDefaults permissions


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething isn't workingdomain:enginepriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions