MCPcopy Create free account
hub / github.com/Noumena-Network/code / hasConsoleBillingAccess

Function hasConsoleBillingAccess

src/utils/billing.ts:69–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69export function hasConsoleBillingAccess(): boolean {
70 // Check if cost reporting is disabled via environment variable
71 if (isEnvTruthy(process.env.DISABLE_COST_WARNINGS)) {
72 return false
73 }
74
75 const config = getGlobalConfig()
76 return hasConsoleBillingAccessForSession(getAuthRuntime().getCurrentSession(), {
77 organizationRole: config.oauthAccount?.organizationRole,
78 workspaceRole: config.oauthAccount?.workspaceRole,
79 })
80}
81
82// Mock billing access for /mock-limits testing (set by mockRateLimits.ts)
83let mockBillingAccessOverride: boolean | null = null

Callers 2

fFunction · 0.85
REPLFunction · 0.85

Calls 5

isEnvTruthyFunction · 0.90
getAuthRuntimeFunction · 0.85
getGlobalConfigFunction · 0.70
getCurrentSessionMethod · 0.65

Tested by

no test coverage detected