Skip to content

proposal: role-scoped field visibility (visibleTo) - #23

Open
delchev wants to merge 1 commit into
mainfrom
spec/role-scoped-visibility
Open

proposal: role-scoped field visibility (visibleTo)#23
delchev wants to merge 1 commit into
mainfrom
spec/role-scoped-visibility

Conversation

@delchev

@delchev delchev commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

A field is as visible as its entity. sensitive: removes one from the scoped surfaces (personal / partner), but nothing scopes a field on the surface everybody else uses — so a salary, a cost price or a credit limit reaches every caller who may read the record at all. Hiding the control in the UI is not a protection: the value is in the response the page rendered from, in the change history, and in the export.

The proposal adds an allow-list on the field:

permissions:
  - { role: Payroll }
  - { role: Administrator }

- name: Employee
  fields:
    - { name: dailyRate, type: decimal, visibleTo: [Payroll, Administrator] }

enforced where the data leaves the server: stripped from every response and ignored on every write, on every surface (owning the record is not a role), withheld from the field-level change trail, inherited by a derived total fed by it, and reflected in the UI from what the server withholds rather than from a role list evaluated in the client.

Allow-list, deliberately not the inverse hiddenFor: — a deny-list fails open: a role added to the application later sees the value, and a misspelled role exposes it.

The proposal also states what is rejected (an undeclared role, an empty list, the primary key / identity field / document title, a label token) and the one case that only warns: a report over a restricted field, which re-serves the figure to everyone the report admits — legitimate to author, never silent.

Implemented in the reference implementation as eclipse-dirigible/dirigible#6747 (issue eclipse-dirigible/dirigible#6550).

🤖 Generated with Claude Code

A field is as visible as its entity: `sensitive:` removes one from the scoped
surfaces, but nothing scopes a field on the surface everyone else uses, so a
salary, a cost price or a credit limit reaches every caller who may read the
record. Hiding the control is not a protection - the value is in the response
the page rendered from.

Proposes an allow-list of roles on the field, enforced where the data leaves the
server: stripped from every response and ignored on every write on ALL surfaces
(owning a record is not a role), withheld from the change trail, inherited by a
derived total fed by it, and reflected in the UI from what the server withholds
rather than from a role list evaluated in the client.

Allow-list, not the inverse `hiddenFor:`: a deny-list fails open - a role added
later sees the value, and a typo exposes it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant