MCPcopy Create free account
hub / github.com/freecodexyz/free-code / hasOpusAccess

Function hasOpusAccess

src/utils/auth.ts:1715–1728  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1713// Returns whether the user has Opus access at all, regardless of whether they
1714// are a subscriber or PayG.
1715export function hasOpusAccess(): boolean {
1716 const subscriptionType = getSubscriptionType()
1717
1718 return (
1719 subscriptionType === 'max' ||
1720 subscriptionType === 'enterprise' ||
1721 subscriptionType === 'team' ||
1722 subscriptionType === 'pro' ||
1723 // subscriptionType === null covers both API users and the case where
1724 // subscribers do not have subscription type populated. For those
1725 // subscribers, when in doubt, we should not limit their access to Opus.
1726 subscriptionType === null
1727 )
1728}
1729
1730export function getSubscriptionType(): SubscriptionType | null {
1731 // Check for mock subscription type first (ANT-only testing)

Callers

nothing calls this directly

Calls 1

getSubscriptionTypeFunction · 0.85

Tested by

no test coverage detected