oliver-zehentleitner / maity

hub: public pages: the kept-role-name rule from project_roles, roles read once per render, one gone-agent holder rule

Sign in to report

tsk-p96evqvzm24y Proposed

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

What is wrong

  • The rule "a custom role that keeps a built-in name" is project_roles.custom_of (project_roles.py:59), used by guide and rules. The public pages spell it again: public_members.py:40 (row.role in ROLES and row.role_base != row.role).
  • public_projects.team_details (public_projects.py:248-255) re-reads all active memberships to rebuild roles and custom, although render_project already holds who with role and role_custom; the re-read also takes isolated memberships and keys by principal.
  • "A holder not among who that was an agent membership" is written twice: public_project_views._gone_agents (public_project_views.py:48-64, batch) and public_cards._gone_agent (public_cards.py:173-180, one per card).

Proposal

  • render_project uses Person.role / Person.role_custom; drop the roles query from team_details; compute role_custom through one helper next to custom_of.
  • One gone-agent helper in public_members taking a set of membership ids; the card page passes its one holder.

Effort / risk: S. Low; page bytes guarded by the digest tests.