MCPcopy Index your code
hub / github.com/simstudioai/sim / isEnterprisePlan

Function isEnterprisePlan

apps/sim/lib/billing/core/subscription.ts:264–282  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

262 * Check if user is on Enterprise plan (direct or via organization)
263 */
264export async function isEnterprisePlan(userId: string): Promise<boolean> {
265 try {
266 if (!isBillingEnabled) {
267 return true
268 }
269
270 const subscription = await getHighestPrioritySubscription(userId)
271 const isEnterprise = subscription && checkEnterprisePlan(subscription)
272
273 if (isEnterprise) {
274 logger.info('User has enterprise plan', { userId, plan: subscription.plan })
275 }
276
277 return !!isEnterprise
278 } catch (error) {
279 logger.error('Error checking enterprise plan status', { error, userId })
280 return false
281 }
282}
283
284/**
285 * Check if user is an admin or owner of an enterprise organization

Callers

nothing calls this directly

Calls 4

checkEnterprisePlanFunction · 0.90
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected