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

Method DeleteGroupAIBudget

coderd/database/dbauthz/dbauthz.go:2064–2074  ·  view source on GitHub ↗
(ctx context.Context, groupID uuid.UUID)

Source from the content-addressed store, hash-verified

2062}
2063
2064func (q *querier) DeleteGroupAIBudget(ctx context.Context, groupID uuid.UUID) (database.GroupAiBudget, error) {
2065 // Removing a group's AI budget counts as updating the group.
2066 group, err := q.db.GetGroupByID(ctx, groupID)
2067 if err != nil {
2068 return database.GroupAiBudget{}, err
2069 }
2070 if err := q.authorizeContext(ctx, policy.ActionUpdate, group); err != nil {
2071 return database.GroupAiBudget{}, err
2072 }
2073 return q.db.DeleteGroupAIBudget(ctx, groupID)
2074}
2075
2076func (q *querier) DeleteGroupByID(ctx context.Context, id uuid.UUID) error {
2077 return deleteQ(q.log, q.auth, q.db.GetGroupByID, q.db.DeleteGroupByID)(ctx, id)

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetGroupByIDMethod · 0.65
DeleteGroupAIBudgetMethod · 0.65

Tested by

no test coverage detected