chore: attempt to nudge agents away from dbauthz.AsSystemRestricted (#23326)

Adds a warning comment to dbauthz.AsSystemRestricted to hopefully nudge agents away from it.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Cian Johnston
2026-03-20 12:18:18 +00:00
committed by GitHub
parent d8cad81ada
commit c8e58575e0
+3
View File
@@ -769,6 +769,9 @@ func AsSubAgentAPI(ctx context.Context, orgID uuid.UUID, userID uuid.UUID) conte
// AsSystemRestricted returns a context with an actor that has permissions
// required for various system operations (login, logout, metrics cache).
// DO NOT USE THIS UNLESS YOU HAVE ABSOLUTELY NO OTHER CHOICE. Prefer using a
// more specific As* helper above (or adding a new, narrowly-scoped one) so
// that permissions remain limited to the operation you need.
func AsSystemRestricted(ctx context.Context) context.Context {
return As(ctx, subjectSystemRestricted)
}