MCPcopy
hub / github.com/simstudioai/sim / getInvitePlanCategoryForUser

Function getInvitePlanCategoryForUser

apps/sim/lib/workspaces/policy.ts:211–220  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

209 * `'free'` when there is no usable paid subscription.
210 */
211export async function getInvitePlanCategoryForUser(userId: string): Promise<PlanCategory> {
212 try {
213 const sub = await getHighestPrioritySubscription(userId)
214 if (!sub || !hasUsableSubscriptionStatus(sub.status)) return 'free'
215 return getPlanType(sub.plan)
216 } catch (error) {
217 logger.error('Failed to resolve subscription for invite policy', { userId, error })
218 return 'free'
219 }
220}
221
222export async function getWorkspaceCreationPolicy({
223 userId,

Callers 2

route.tsFile · 0.90

Calls 4

getPlanTypeFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected