(ctx context.Context, arg database.GetChatCostPerChatParams)
| 2841 | } |
| 2842 | |
| 2843 | func (q *querier) GetChatCostPerChat(ctx context.Context, arg database.GetChatCostPerChatParams) ([]database.GetChatCostPerChatRow, error) { |
| 2844 | // The owner's chats, may cross orgs. AnyOrganization() authorizes |
| 2845 | // the caller if they hold read permission on chats owned by |
| 2846 | // arg.OwnerID in any org they belong to. |
| 2847 | // TODO(CODAGT-161): the underlying SQL queries filter only by owner_id, not |
| 2848 | // organization_id. |
| 2849 | if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceChat.WithOwner(arg.OwnerID.String()).AnyOrganization()); err != nil { |
| 2850 | return nil, err |
| 2851 | } |
| 2852 | return q.db.GetChatCostPerChat(ctx, arg) |
| 2853 | } |
| 2854 | |
| 2855 | func (q *querier) GetChatCostPerModel(ctx context.Context, arg database.GetChatCostPerModelParams) ([]database.GetChatCostPerModelRow, error) { |
| 2856 | // See GetChatCostPerChat for the authorization rationale. |
nothing calls this directly
no test coverage detected