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

Method GetGroupAIBudget

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

Source from the content-addressed store, hash-verified

3486}
3487
3488func (q *querier) GetGroupAIBudget(ctx context.Context, groupID uuid.UUID) (database.GroupAiBudget, error) {
3489 // Reading a group's AI budget requires read on the parent group.
3490 group, err := q.db.GetGroupByID(ctx, groupID)
3491 if err != nil {
3492 return database.GroupAiBudget{}, err
3493 }
3494 if err := q.authorizeContext(ctx, policy.ActionRead, group); err != nil {
3495 return database.GroupAiBudget{}, err
3496 }
3497 return q.db.GetGroupAIBudget(ctx, groupID)
3498}
3499
3500func (q *querier) GetGroupByID(ctx context.Context, id uuid.UUID) (database.Group, error) {
3501 return fetch(q.log, q.auth, q.db.GetGroupByID)(ctx, id)

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetGroupByIDMethod · 0.65
GetGroupAIBudgetMethod · 0.65

Tested by

no test coverage detected