Files
DeskcommCRM/plan
Rafael Melgaço f12172450a feat(G6-00): per-role RLS on lead activities/links — migration 0042 [gov-loop]
Closes INB-10 (G6-03 precondition): SELECT of crm_lead_activities/crm_lead_links
now requires parent-lead visibility via EXISTS + fn_can_view_lead (reused from
G4-03, not scalar-subquery). crm_lead_links FOR ALL dropped, re-expressed
per-command. Write kept org-scope (polymorphic timeline written by service
role/AI/panel must not break — service-role-insert=1, agent-own-insert=1).
gov-5e (8 tests): cross-attendant reads = 0, own = 1, manager org-wide.
Verified-by: gov-verifier PASS 2026-07-18T19:07:30-0300
2026-07-18 19:07:30 -03:00
..