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

Method UpdateChatMessageByID

coderd/database/dbauthz/dbauthz.go:6713–6727  ·  view source on GitHub ↗
(ctx context.Context, arg database.UpdateChatMessageByIDParams)

Source from the content-addressed store, hash-verified

6711}
6712
6713func (q *querier) UpdateChatMessageByID(ctx context.Context, arg database.UpdateChatMessageByIDParams) (database.ChatMessage, error) {
6714 // Authorize update on the parent chat of the edited message.
6715 msg, err := q.db.GetChatMessageByID(ctx, arg.ID)
6716 if err != nil {
6717 return database.ChatMessage{}, err
6718 }
6719 chat, err := q.db.GetChatByID(ctx, msg.ChatID)
6720 if err != nil {
6721 return database.ChatMessage{}, err
6722 }
6723 if err := q.authorizeContext(ctx, policy.ActionUpdate, chat); err != nil {
6724 return database.ChatMessage{}, err
6725 }
6726 return q.db.UpdateChatMessageByID(ctx, arg)
6727}
6728
6729func (q *querier) UpdateChatModelConfig(ctx context.Context, arg database.UpdateChatModelConfigParams) (database.ChatModelConfig, error) {
6730 if err := q.authorizeContext(ctx, policy.ActionUpdate, rbac.ResourceDeploymentConfig); err != nil {

Callers

nothing calls this directly

Calls 4

authorizeContextMethod · 0.95
GetChatMessageByIDMethod · 0.65
GetChatByIDMethod · 0.65
UpdateChatMessageByIDMethod · 0.65

Tested by

no test coverage detected