Skip to content

[docs] Access and governance for 3.1: service accounts, departments, government organizations - #142

Draft
billjohnc wants to merge 2 commits into
mainfrom
claude/docs-access-governance-3-1-9879
Draft

billjohnc wants to merge 2 commits into
mainfrom
claude/docs-access-governance-3-1-9879

Conversation

@billjohnc

Copy link
Copy Markdown
Contributor

Summary

Refreshes the Care 3.1 access and governance pages that no other open PR covers, and adds service account pages (gap G9 of the 28 Nov docs review). Version 3.1 only.

Verified against care ddfd840 (develop, 23 Nov) and care_fe abf394594 (develop, 30 Nov). Pins approved by billjohnc.

Branches from main. It does not touch any file of #136, #132, #129, #135 or #113.

Pages

New

  • concepts/access-governance/service-account.mdx: Service account
  • flows/access-governance/service-account/: Create a service account; Add a service account to an organization or department; Generate a token for a service account; Revoke a service account's token; Change a service account's role or remove it
  • flows/access-governance/responsibility/manage-responsibilities-from-profile.mdx: Add or remove a person's responsibilities from their profile

Replaced (same slug)

  • concepts/facility/department.mdx: Department ("Admin" removed as a facility role; Administration described as the root beside the other departments, matching [docs] Tag configuration expiry and facility organization tree for 3.1 #132)
  • flows/facility/department/: create-department, update-department, delete-department
  • flows/access-governance/organization/view-organization-hierarchy.mdx: now "Open a government organization", the staff view (dashboard Governance tab, sub-organizations, each tab)
  • Superuser-only, refreshed from code, no media (billjohnc kept them on 30 Nov: "even a super user will be referring docs.ohc.network"): create-organization, update-organization, delete-organization, create-role, edit-or-clone-role, view-permissions-matrix, create-responsibility, link-responsibilities. Each opens with an info box that says only a superuser can do it (since care_fe c5f291af9, all of /admin is behind a superuser route guard).

Sidebar: two additions only: the new responsibility flow, and a "Service Account" category after "Responsibility".

How it was verified

  • Every sentence was drafted from a numbered fact (file, line and quote at the pinned commits, or a runtime check), then read by a reviewer with fresh context.
  • Permission tables cover the whole path: reaching the screen, the control, the pickers and the save. They give display names, where each permission must be held, and the default roles.
  • Runtime on a local stack (care ddfd840 backend, care_fe abf394594 frontend, invented data only): role lists by context (one "Admin" role, Responsibility only; the government and facility pickers never offer it), and which roles each role can give under the role-subset rule (an Administrator can give only Administrator or Volunteer; a Facility Admin any facility role).
  • Media: 10 narrated videos (mp4 + vtt, kept in the repo; nothing uploaded to YouTube) and one screenshot per step, recorded as ordinary users: Dr. Anjali Varma (Administrator of the government organization Kerala), Rohan Kapoor (Facility Admin), Dr. Sanjay Gupta (Admin of a responsibility). Names, contact details and the service account token are blurred in the browser while recording. Every take's API log matched the permission path in the page (no 403s).
  • Narration: each line is the step plus a sentence of context from the page's own text, with no step numbers; subtitles show what is said. The voices are AI-generated with ElevenLabs (model eleven_v4): cloned voices of Gauri and Bill, alternating flow by flow in sidebar order. Where a line is longer than its step, the video holds a settled frame and the subtitles are timed to match.
  • The superuser-only pages were not recorded (no superuser sign-in in this setup).

Differences from the docs skills, on purpose

  • Simplified Technical English is used for instructions only; explanations are plain English.
  • Pages go to 3.1 only.
  • The Permissions table covers the whole permission path, not only the final permission.
  • "Admin" is never listed as a facility or government-organization role.

Supersedes older drafts

#61, #67 (roles), #68 (organizations) and #72 (responsibilities), by github-actions, cover the same ground on an older base with flat flow paths. Their leads were checked against the code. This PR supersedes their 3.1 content; they can be closed.

For other open PRs

  • [docs] Users, profile, user lists and Facility General for 3.1 #136: in a government organization an Administrator can give only the Administrator or Volunteer role (runtime); its government variants of assign and change role could say so. Its responsibility concept calls responsibilities "a flat list", but the code lets a superuser create one under another (parent/child refusals exist; no screen offers it). Its responsibility concept also uses older section names ("Managing Organizations", "Managed Responsibilities"); the screen now says "What responsibilities can {name} manage?" and "Who can manage {name}?". Its concepts say "super administrator"; these pages say "superuser". The organization concept and create-user could link the new service account pages.
  • [docs] Tag configuration expiry and facility organization tree for 3.1 #132: no conflict; department.mdx links facility-organization.mdx for the tree.

Left out (not verifiable, or open)

  • How to open a service account's profile from a department (no link on the department card was found in code); the token pages describe the government organization route only.
  • How a non-superuser retires a service account: there is no way except revoking its token and removing its roles (only a superuser can delete it).
  • "Is Geo Admin" is left out of all permission tables: no default role holds it.

Suspected product issues (not filed)

Verified line by line against the pinned code by a separate pass; full list (46 items) with file and line references in the session report. The ones users meet:

High

  • Government organizations: by default no ordinary user can give the Doctor, Nurse or Staff role. An Administrator can give only Administrator or Volunteer (role-subset rule), and the "Admin" role cannot be assigned there (next item). Runtime-confirmed (403).
  • The two default roles named "Admin" become one stored role with only the Responsibility context and both permission sets (role sync matches by name; care/security/roles/role.py:57-67, sync_permissions_roles.py:38-44). So Admin is never offered in a government organization or a facility, and a responsibility Admin can create users and service accounts.
  • A responsibility that no responsibility manages accepts "Can Manage Connected Role Organizations" held anywhere (security/authorization/organization.py:78-82 with base.py:37-38), so a Manager elsewhere can add, re-role and remove its members.

Medium

  • A service account's token can be managed only by its creator, and no ordinary user can delete or deactivate a service account; if the creator leaves, nobody can revoke a leaked token from the screen (viewsets/user.py:260-262, UserSummary.tsx:68-69).
  • Sign-in and "Forgot password" have no service-account check, so whoever controls a service account's email can sign in as it (auth_views.py:67-80, reset_password_views.py:186-190).
  • Department controls follow the facility-wide union of your roles while the backend checks the department chain: Add, Edit, Delete and Link show where you are refused. The Delete icon shows to Administrators, but only a Facility Admin can delete (FacilityOrganizationView.tsx:340-342, viewsets/facility_organization.py:139-144).
  • Profile → Responsibility Assignments → Manage shows to every viewer, and its delete removes at once with no confirmation (UserRoleOrganizationAccess.tsx:244-289).
  • A responsibility's Patients tab lists every patient you can reach, not the responsibility's (OrganizationPatients.tsx:100).
  • /api/v1/govt/organization/ needs no sign-in and lists every organization type (config/api_router.py:217-219).
  • A description cannot be cleared on organizations, responsibilities or departments, though Care shows success (resources/base.py:92).
  • Admin screens: Delete enabled on sub-organizations with children; the header "Add Organization" always creates a top-level one; unlinking a responsibility asks to remove it "from the patient"; Select All during a permission search drops earlier choices.

Low (selection) renaming to a sibling's name is not refused; "Max location reached" for departments; the dashboard Governance tab flashes "No Results Found" before loading; the username checklist allows "." but the form rejects it; hard-coded English tab labels and " (Copy)"; icon buttons without accessible names.

🤖 Generated with Claude Code

billjohnc and others added 2 commits November 30, 2026 18:34
…ages

Concept: new service account concept; department concept checked against 3.1.
Flows: open a government organization; create, edit and delete a department;
five service account flows; add or remove responsibilities from a profile;
the eight superuser-only flows (organizations, roles, responsibilities)
refreshed from code and marked superuser-only, as billjohnc decided.
Verified against care ddfd840 and care_fe abf394594.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 narrated videos (mp4 + vtt) and one screenshot per step for the
department, government organization, responsibility and service account
flows, recorded as ordinary users on a local stack with invented data,
blurred in the browser. Pages: which roles you can give (role-subset rule,
confirmed at runtime), the facility route to a profile, and three step
fixes found while recording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying coredocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29c1d25
Status: ✅  Deploy successful!
Preview URL: https://a2f37288.coredocs.pages.dev
Branch Preview URL: https://claude-docs-access-governanc.coredocs.pages.dev

View logs

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.

1 participant