The query came in at 2 a.m., and it shouldn't have worked.
Someone had slipped into a role that never existed yesterday, yet had the keys to data they should never touch. That’s the danger when database roles are static, and ad hoc access control is an afterthought. In modern systems, permission models built for fixed roles can break under the weight of unforeseeable queries, temporary needs, and human urgency.
Database Roles and the Fragility of Access Models
Traditional database roles bundle permissions into neat shapes: admin, analyst, developer. It’s clean until the real world hits. Emergencies, special audits, and one-off migrations all demand temporary, granular access. Static role definitions can force you to over-provision or leave engineers waiting for days, both of which put systems at risk.
Without ad hoc access control, temporary exceptions become permanent holes. The more we create broad “just in case” roles, the more our privilege creep metastasizes. Attackers look for these forgotten permissions. Compliance teams chase them down like debris after a storm.
Ad Hoc Access Control in the Real World
Ad hoc access control means you grant and revoke permissions in real time, scoped to exact needs, and with an expiry baked in from the start. Done right, it shrinks the attack surface to only what is necessary in the moment. It works alongside database roles instead of replacing them. Roles define the baseline; ad hoc controls patch the gaps without rewriting entire policies.