MCPcopy Index your code
hub / github.com/coder/coder / GetChatAutoArchiveDays

Method GetChatAutoArchiveDays

coderd/database/dbauthz/dbauthz.go:2812–2821  ·  view source on GitHub ↗
(ctx context.Context, defaultAutoArchiveDays int32)

Source from the content-addressed store, hash-verified

2810}
2811
2812func (q *querier) GetChatAutoArchiveDays(ctx context.Context, defaultAutoArchiveDays int32) (int32, error) {
2813 // Chat auto-archive is a deployment-wide config read by dbpurge.
2814 // Only requires a valid actor in context. The HTTP GET handler
2815 // allows any authenticated user; the PUT handler enforces admin
2816 // access (policy.ActionUpdate on ResourceDeploymentConfig).
2817 if _, ok := ActorFromContext(ctx); !ok {
2818 return 0, ErrNoActor
2819 }
2820 return q.db.GetChatAutoArchiveDays(ctx, defaultAutoArchiveDays)
2821}
2822
2823func (q *querier) GetChatByID(ctx context.Context, id uuid.UUID) (database.Chat, error) {
2824 return fetch(q.log, q.auth, q.db.GetChatByID)(ctx, id)

Callers

nothing calls this directly

Calls 2

ActorFromContextFunction · 0.70

Tested by

no test coverage detected