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

Method UpsertTaskSnapshot

coderd/database/dbauthz/dbauthz.go:8296–8308  ·  view source on GitHub ↗
(ctx context.Context, arg database.UpsertTaskSnapshotParams)

Source from the content-addressed store, hash-verified

8294}
8295
8296func (q *querier) UpsertTaskSnapshot(ctx context.Context, arg database.UpsertTaskSnapshotParams) error {
8297 // Fetch task to build RBAC object for authorization.
8298 task, err := q.GetTaskByID(ctx, arg.TaskID)
8299 if err != nil {
8300 return err
8301 }
8302
8303 if err := q.authorizeContext(ctx, policy.ActionUpdate, task.RBACObject()); err != nil {
8304 return err
8305 }
8306
8307 return q.db.UpsertTaskSnapshot(ctx, arg)
8308}
8309
8310func (q *querier) UpsertTaskWorkspaceApp(ctx context.Context, arg database.UpsertTaskWorkspaceAppParams) (database.TaskWorkspaceApp, error) {
8311 // Fetch the task to derive the RBAC object and authorize update on it.

Callers

nothing calls this directly

Calls 4

GetTaskByIDMethod · 0.95
authorizeContextMethod · 0.95
RBACObjectMethod · 0.65
UpsertTaskSnapshotMethod · 0.65

Tested by

no test coverage detected