(ctx context.Context, arg database.InsertTaskParams)
| 5764 | } |
| 5765 | |
| 5766 | func (q *querier) InsertTask(ctx context.Context, arg database.InsertTaskParams) (database.TaskTable, error) { |
| 5767 | // Ensure the actor can access the specified template version (and thus its template). |
| 5768 | if _, err := q.GetTemplateVersionByID(ctx, arg.TemplateVersionID); err != nil { |
| 5769 | return database.TaskTable{}, err |
| 5770 | } |
| 5771 | |
| 5772 | obj := rbac.ResourceTask.WithOwner(arg.OwnerID.String()).InOrg(arg.OrganizationID) |
| 5773 | |
| 5774 | return insert(q.log, q.auth, obj, q.db.InsertTask)(ctx, arg) |
| 5775 | } |
| 5776 | |
| 5777 | func (q *querier) InsertTelemetryItemIfNotExists(ctx context.Context, arg database.InsertTelemetryItemIfNotExistsParams) error { |
| 5778 | if err := q.authorizeContext(ctx, policy.ActionCreate, rbac.ResourceSystem); err != nil { |
nothing calls this directly
no test coverage detected