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

Method UpsertGroupAIBudget

coderd/database/dbauthz/dbauthz.go:8189–8199  ·  view source on GitHub ↗
(ctx context.Context, arg database.UpsertGroupAIBudgetParams)

Source from the content-addressed store, hash-verified

8187}
8188
8189func (q *querier) UpsertGroupAIBudget(ctx context.Context, arg database.UpsertGroupAIBudgetParams) (database.GroupAiBudget, error) {
8190 // Setting a group's AI budget counts as updating the group.
8191 group, err := q.db.GetGroupByID(ctx, arg.GroupID)
8192 if err != nil {
8193 return database.GroupAiBudget{}, err
8194 }
8195 if err := q.authorizeContext(ctx, policy.ActionUpdate, group); err != nil {
8196 return database.GroupAiBudget{}, err
8197 }
8198 return q.db.UpsertGroupAIBudget(ctx, arg)
8199}
8200
8201func (q *querier) UpsertHealthSettings(ctx context.Context, value string) error {
8202 if err := q.authorizeContext(ctx, policy.ActionUpdate, rbac.ResourceDeploymentConfig); err != nil {

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetGroupByIDMethod · 0.65
UpsertGroupAIBudgetMethod · 0.65

Tested by

no test coverage detected