From 1d7eb33169e36fdb37cb84cf6c920fe5b42f6539 Mon Sep 17 00:00:00 2001 From: John Gemignani Date: Thu, 3 Sep 2026 17:00:08 -0700 Subject: [PATCH] Add RLS and SELECT privilege enforcement to global graph The global graph cache that backs variable-length edge (VLE) and shortest-path traversal is populated with a direct heap scan (table_beginscan + heap_getnext). That scan does not go through the planner or executor, so the row-level security policies and table privileges that MATCH receives automatically are not applied to traversal: it reads every vertex and edge regardless of the current role's policies or grants. Add age.enforce_rls_in_traversal (bool, PGC_SUSET, default on). When on: * SELECT privilege is checked on every label table before it is read (pg_class_aclcheck, with a pg_attribute_aclcheck fallback so column-level grants are honored the same way the executor honors them). * When RLS is active on a label for the current role, that label is loaded through SPI (SELECT ... FROM ONLY