Skip to content

feat(viewer): show and edit the admin registers, the audit category map and the access delay (#6643) - #6692

Open
rubentalstra wants to merge 50 commits into
mainfrom
feat/viewer-admin-registers
Open

rubentalstra wants to merge 50 commits into
mainfrom
feat/viewer-admin-registers

Conversation

@rubentalstra

Copy link
Copy Markdown
Member

Closes #6643

This branch builds on #6687 (#6646), which builds on #6683 and #6669. It carries their commits until they merge. Review only the commits after #6687.

The Access policy area gains a tab for each admin register: Audit categories (audit-categories) and Access delay (access-delay). Both read GET {ext}/admin/registers/{register} and /history. No openEHR specification governs the registers: this is FerroEHR's own design.

  • Register tab: the version in force with its committer and commit time. Version 0 says it is the default no one committed. The document is drawn by its members:

    • the access delay: enabled, categories, max_delay;
    • the category map: shipped_map, national, templates, archetypes, each template or archetype with its categories or none.

    The whole document follows the members.

  • History: every version, newest first, ending with version 0. Each opens read-only at ?version=N with a notice and no edit.

  • Edit the register (/access-policy/registers/{register}/edit) replaces the document in the code editor and saves with If-Match naming the version opened. A 400 or 412 is drawn beside the editor in the CDR's words, with the document kept and a reload offered after a conflict.

  • Refusals: a 403 says the account may not read the register. A 405 says the admin API is off, so this cannot be read here; that message is now worded for the whole Access policy area.

The recorder commits a version of the access delay over the default, so the history holds two versions.

Tests

  • ssr_app::registers runs over the re-recorded CDR. It covers the access delay drawn by its members with its history and the default, an older version opened read-only, the category map's default, a save over version 0 that the CDR refuses with 412 (recorded live), and the 403 and 405, as stubs.
  • e2e_registers (a browser journey) reads the access delay and its history, then saves the document as the next version and finds that version shown.
  • Docs shots: the access delay, the category map and the editor. Unit tests cover the version and history readings and the register keys.

Docs

  • The book's viewer/access-control.md has an admin registers section.
  • Changelog fragment 6643-viewer-admin-registers.added.md.

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.
…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.
…carer (#6646)

An EHR's Care tab lists its subject's care relationships, live ones by
default and ended ones on request; a party's Care page shows the same for
a PERSON with the form that adds one, and the subjects in a carer's care,
paged in the session; a relationship's page shows its versions and
changes its role or period, ends it today or deletes it, each with
If-Match. The recorder seeds the subject's PERSON with three care
relationships and the provider ORGANISATION the dev binding names.
pages::common may not grow past its recorded length, so the editor
helpers move to a module of their own.
…ap and the access delay (#6643)

The Access policy area has a tab for each admin register: the version in
force drawn by its members, the history back to version 0, any version
opened read-only, and an editor saving with If-Match. The recorder
commits a version of the access delay over the default.
…he care journey an end date

The EHR now draws six tabs, so FerroUI shows a select in place of the row
on a phone; the journey's care relationship needs an end, since the e2e
access policy holds no relationship_validity default for an open one.
# 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
…tionships

# Conflicts:
#	app/ferroehr-viewer/src/bff/mod.rs
# Conflicts:
#	app/ferroehr-viewer/src/locale.rs
#	scripts/checks/stray-literals.allow
…registers

# Conflicts:
#	app/ferroehr-viewer/src/bff/mod.rs

This branch has not been deployed

No deployments
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.

The viewer shows and edits the admin registers: the audit category map and the access delay

1 participant