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

Method UpdateTaskPrompt

coderd/database/dbauthz/dbauthz.go:7203–7216  ·  view source on GitHub ↗
(ctx context.Context, arg database.UpdateTaskPromptParams)

Source from the content-addressed store, hash-verified

7201}
7202
7203func (q *querier) UpdateTaskPrompt(ctx context.Context, arg database.UpdateTaskPromptParams) (database.TaskTable, error) {
7204 // An actor is allowed to update the prompt of a task if they have
7205 // permission to update the task (same as UpdateTaskWorkspaceID).
7206 task, err := q.db.GetTaskByID(ctx, arg.ID)
7207 if err != nil {
7208 return database.TaskTable{}, err
7209 }
7210
7211 if err := q.authorizeContext(ctx, policy.ActionUpdate, task.RBACObject()); err != nil {
7212 return database.TaskTable{}, err
7213 }
7214
7215 return q.db.UpdateTaskPrompt(ctx, arg)
7216}
7217
7218func (q *querier) UpdateTaskWorkspaceID(ctx context.Context, arg database.UpdateTaskWorkspaceIDParams) (database.TaskTable, error) {
7219 // An actor is allowed to update the workspace ID of a task if they are the

Callers

nothing calls this directly

Calls 4

authorizeContextMethod · 0.95
GetTaskByIDMethod · 0.65
RBACObjectMethod · 0.65
UpdateTaskPromptMethod · 0.65

Tested by

no test coverage detected