(organizationId: string)
| 426 | * Used for Access Control (Permission Groups) feature gating |
| 427 | */ |
| 428 | export async function isOrganizationOnEnterprisePlan(organizationId: string): Promise<boolean> { |
| 429 | try { |
| 430 | if (!isBillingEnabled) { |
| 431 | return true |
| 432 | } |
| 433 | |
| 434 | if (isAccessControlEnabled && !isHosted) { |
| 435 | return true |
| 436 | } |
| 437 | |
| 438 | if (await isOrganizationBillingBlocked(organizationId)) { |
| 439 | return false |
| 440 | } |
| 441 | |
| 442 | const orgSub = await getOrganizationSubscriptionUsable(organizationId) |
| 443 | |
| 444 | return !!orgSub && checkEnterprisePlan(orgSub) |
| 445 | } catch (error) { |
| 446 | logger.error('Error checking organization enterprise plan status', { error, organizationId }) |
| 447 | return false |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | /** |
| 452 | * Check if user has access to credential sets (email polling) feature |
no test coverage detected