(userId: string)
| 478 | * In non-production environments, returns true for convenience. |
| 479 | */ |
| 480 | export async function hasSSOAccess(userId: string): Promise<boolean> { |
| 481 | try { |
| 482 | if (isSsoEnabled && !isHosted) { |
| 483 | return true |
| 484 | } |
| 485 | |
| 486 | return isEnterpriseOrgAdminOrOwner(userId) |
| 487 | } catch (error) { |
| 488 | logger.error('Error checking SSO access', { error, userId }) |
| 489 | return false |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | /** |
| 494 | * Check whether a workspace is entitled to the Access Control (Permission Groups) |
no test coverage detected