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

Method InsertChatMessages

coderd/database/dbauthz/dbauthz.go:5507–5517  ·  view source on GitHub ↗
(ctx context.Context, arg database.InsertChatMessagesParams)

Source from the content-addressed store, hash-verified

5505}
5506
5507func (q *querier) InsertChatMessages(ctx context.Context, arg database.InsertChatMessagesParams) ([]database.ChatMessage, error) {
5508 // Authorize create on the parent chat (using update permission).
5509 chat, err := q.db.GetChatByID(ctx, arg.ChatID)
5510 if err != nil {
5511 return nil, err
5512 }
5513 if err := q.authorizeContext(ctx, policy.ActionUpdate, chat); err != nil {
5514 return nil, err
5515 }
5516 return q.db.InsertChatMessages(ctx, arg)
5517}
5518
5519func (q *querier) InsertChatModelConfig(ctx context.Context, arg database.InsertChatModelConfigParams) (database.ChatModelConfig, error) {
5520 if err := q.authorizeContext(ctx, policy.ActionUpdate, rbac.ResourceDeploymentConfig); err != nil {

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetChatByIDMethod · 0.65
InsertChatMessagesMethod · 0.65

Tested by

no test coverage detected