diff --git a/coderd/database/dbauthz/dbauthz.go b/coderd/database/dbauthz/dbauthz.go index 6f9b2d4bf4..e6601fe831 100644 --- a/coderd/database/dbauthz/dbauthz.go +++ b/coderd/database/dbauthz/dbauthz.go @@ -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) }