Repository navigation
feat(viewer): list the roles and grants in force and mark a policy party (#6644) - #6683
Queued
rubentalstra wants to merge 17 commits into
Queued
rubentalstra wants to merge 17 commits into
rubentalstra wants to merge 17 commits into
Conversation
A new Access policy page in the console group draws the controller's ACCESS_POLICY in force by section, each coded value with its rubric and code; its Versions tab lists every version and opens any one read-only; an administrator edits the whole policy in the code editor, saved with If-Match naming the version read (If-None-Match: * for the first). While none is committed the page says nothing is tightened; a 403 and an admin API that is off are drawn as such. The recorder of the replayed CDR provisions its user with the four arguments scim-provision.sh takes, takes its container name from the environment, and seeds two versions of the policy under a write_access_policy grant its own test ceiling admits; the e2e lane seeds the same for its journey.
…ave words The access policy editor, Edit as a new version and the party editors share Unsaved, editor_line, save_as_words and reload_words in pages::common, and Access policy words an attribute as Configuration does; the book page names its audience.
rubentalstra
enabled auto-merge
November 26, 2026 12:14
…hic class (#6644) The allow line for the AQL the viewer sends the CDR matches each FROM root AQL defines, EHR and the demographic classes, so the roles and grants queries pass and any other string that starts with SELECT is still read.
Member
Author
|
The stray-literals allow line for AQL now matches AQL's own FROM roots, |
pages::common may not grow past its recorded length, so the editor helpers move to a module of their own.
…ver a version pages::editor::document_form docks the decision bar and draws the refusal, the code editor and its findings; the access policy editor takes it, and Access policy reads an instant through one pages::policy::instant.
rubentalstra
added this pull request to the merge queue
Nov 26, 2026
Any commits made after this event will not be merged.
# Conflicts: # app/ferroehr-viewer/locales/policy/en/policy.ftl # app/ferroehr-viewer/locales/shell/en/shell.ftl # app/ferroehr-viewer/src/locale/policy.rs # app/ferroehr-viewer/src/pages/policy/mod.rs # app/ferroehr-viewer/src/routes.rs # app/ferroehr-viewer/src/shell.rs # app/ferroehr-viewer/tests/fixtures/cdr/manifest.json # app/ferroehr-viewer/tests/fixtures/cdr/recording.json # app/ferroehr-viewer/tests/it/e2e_docs_shots.rs # app/ferroehr-viewer/tests/it/ssr_app.rs # scripts/viewer-record.sh # website/book/src/viewer/access-control.md # website/book/src/viewer/index.md
rubentalstra
enabled auto-merge
November 26, 2026 18:25
rubentalstra
added this pull request to the merge queue
Nov 26, 2026
Any commits made after this event will not be merged.
# Conflicts: # app/ferroehr-viewer/src/locale.rs # scripts/checks/stray-literals.allow
rubentalstra
added this pull request to the merge queue
Nov 26, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
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.
Closes #6644
This branch builds on #6669 (#6642, the access policy page) and carries its commits until that PR merges. Review only the commits after it.
Roles and grants (
/grants, console group) lists the policy parties for an administrator. It reads them through AQL rooted atROLE,AGENTandPARTY_RELATIONSHIP, so the CDR's policy-party rule decides what is shown. An administrator reads every policy party. Any other caller gets an empty answer, which the page draws as "no role holds a grant". A403says the account may not read grants. No openEHR specification governs grants: this is FerroEHR's own design over its draft access control package.SELECT DISTINCT r FROM ROLE r CONTAINS CAPABILITY c CONTAINS ELEMENT e WHERE e/value/defining_code/terminology_id/value = 'openehr_access'. Each row shows:openehr_access;scopeorbinding_issuer;time_validity;not_beforeandnot_after, as the book's "How a request reads its grants" describes.openehr_access::client_id, with the client id and issuer. The provider each acts for comes from theopenehr_access::acts_forrelationships.ROLE, written in the party editor. Each row opens its role.ROLEthese come from its own document; for an actor, from AQL onr/performer/id/value.The recorder now makes its user the first administrator (
FERROEHR__AUTHZ__RBAC__FIRST_ADMIN=ferroehr), so the user reads the policy parties. It also grants a system clientread_change_feedand writes that client's acts-for relationship to the clinic. Both grants are the recording's own and are admitted only by the recorder's test ceiling.Tests
ssr_app::grantsruns over the re-recorded CDR. It covers the list (write_access_policy,read_change_feed,hold_scopes, the system agent, its issuer and its provider), a403, and the mark on an agent's page and a role's page. It also checks that an ordinary person page carries no mark.e2e_grants(a browser journey) lists the grants the e2e lane gives its SCIM clients and Basic users, then opens thebasic-usersagent and finds its mark./grants. Unit tests cover the role and agent readings, the in-force rule and the mark.Docs
viewer/access-control.mdhas a Roles and grants section, and the viewer index lists the page.6644-viewer-roles-grants.added.md.