proposal: role-scoped field visibility (visibleTo) - #23
Open
delchev wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
labeltoken) 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