mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
Stop a delegate deferring somebody else's medication reminders
Found by an adversarial pass over the release candidate before it was tagged, and it is the reason the tag waited. `POST /api/medications/intake` is admitted for delegates because a caregiver standing next to the patient has to be able to say the tablet went down. It is an update, though, and the same body can carry two other things. Snoozing writes `snoozedUntil` on the OWNER's medication row, and the reminder cron skips that medication for as long as the stamp is in the future. The field takes any future instant. So somebody with write access could stop another person's medication reminders for years, and three things made it quiet: the owner is deliberately not notified of a delegated snooze, the activity feed renders the whole family as "marked a dose", and the only accurate trace was a line in the admin audit log. The second was flipping a dose the owner had already recorded — taken to skipped and back, which rewrites their compliance history and refunds inventory. The consent screen promises that changing what is already there stays with the owner. Both refuse for a delegate now and stay open to the owner, who is the only person either was ever for. A refused attempt is filed under the owner and gets its own sentence in the activity panel rather than borrowing the one for marking a dose, because folding them together is what made the gap dangerous. Two more from the same pass: The consent notice named allergies among the things a delegate may add. That left the admitted set before this release shipped, and it said so in six languages on the one screen where somebody decides who may write into their health record. It also omitted half of what IS admitted. The copy now matches the frozen list, and the test asserts the withdrawal rather than only the presence of the rest. The banner told a WRITE delegate nothing at all — the mode line rendered only in the read case, guarded by a comment stating that write grants did not exist yet. This is the release that made them exist. It matters that the banner say it, because the rule that a refused control is absent rather than disabled rests on the banner naming the mode globally. And a third instance of the substitution this release already fixed twice: the BMI chart divided the owner's weights by the height of whoever was looking. Inside a shared record it draws nothing now rather than a number belonging to two different people.
This commit is contained in:
1 parent
7ff420477c
commit
69343c8820
15 files changed
+260
-32
No files matched your search
@@ -22,9 +22,13 @@ import {
|
||||
* ## The two answers, and why there are two
|
||||
*
|
||||
* A grant at WRITE admits a short, closed list of verbs: entering readings,
|
||||
* lab results, allergies, family history, an illness entry, a biomarker, a
|
||||
* tracked value, a side effect, a medication, and marking a dose taken. It
|
||||
* admits nothing else. Editing, deleting, restoring, purging, importing and
|
||||
* lab results, an illness entry, a biomarker, a tracked value, a side effect, a
|
||||
* medication, and marking a dose taken or skipped. It admits nothing else.
|
||||
* Allergies and family history were on this list and left it before v1.36.1
|
||||
* shipped — the argument for them held, but the only surface that posts to
|
||||
* either lives under `/settings`, which a switch closes, so the permission had
|
||||
* no reachable caller. `delegable-surface-guard.test.ts` carries that argument
|
||||
* in full and is the list that binds; this paragraph has to agree with it. Editing, deleting, restoring, purging, importing and
|
||||
* bulk-acting stay with the owner, including on an entry the delegate added
|
||||
* themselves a minute ago, and so does every create the list does not name
|
||||
* (a mood entry, a screener, a cycle day). Two booleans carry that:
|
||||
|
||||
Reference in new issue
Block a user