(ctx context.Context, arg database.UpdatePresetPrebuildStatusParams)
| 7040 | } |
| 7041 | |
| 7042 | func (q *querier) UpdatePresetPrebuildStatus(ctx context.Context, arg database.UpdatePresetPrebuildStatusParams) error { |
| 7043 | preset, err := q.db.GetPresetByID(ctx, arg.PresetID) |
| 7044 | if err != nil { |
| 7045 | return err |
| 7046 | } |
| 7047 | |
| 7048 | // TODO: This does not check the acl list on the template. Should it? |
| 7049 | object := rbac.ResourceTemplate. |
| 7050 | WithID(preset.TemplateID.UUID). |
| 7051 | InOrg(preset.OrganizationID) |
| 7052 | |
| 7053 | err = q.authorizeContext(ctx, policy.ActionUpdate, object) |
| 7054 | if err != nil { |
| 7055 | return err |
| 7056 | } |
| 7057 | |
| 7058 | return q.db.UpdatePresetPrebuildStatus(ctx, arg) |
| 7059 | } |
| 7060 | |
| 7061 | func (q *querier) UpdatePresetsLastInvalidatedAt(ctx context.Context, arg database.UpdatePresetsLastInvalidatedAtParams) ([]database.UpdatePresetsLastInvalidatedAtRow, error) { |
| 7062 | // Fetch template to check authorization |
nothing calls this directly
no test coverage detected