oliver-zehentleitner / maity

hub: routes build the owner_only and owner-side isolated refusals through helpers (eight inline copies)

Sign in to report

tsk-2njh2tg1kx80 Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: duplication.

What is wrong

  • routes/members.owner_only(message) (routes/members.py:563) builds the 403 owner_only; inline copies at routes/projects.py:1896 and :1910 (both new), routes/joins.py:659, routes/placements.py:1135, routes/invitations.py:163. projects._authorise_patch also spells mine.trust != "owner" or mine.kind != "human" three times.
  • The 403 isolated refusal for an owner acting on an isolated agent is built inline three times: routes/joins.py:386-391, routes/placements.py:607-612, routes/members.py:1897-1903. isolation.refusal(row) (isolation.py:32-40) covers only the agent own calls.

Proposal

  • Move owner_only to errors and add require_human_owner(mine, message); add isolation.owner_refusal(action).

Effort / risk: S. Low.