(userId: string)
| 457 | * In non-production environments, returns true for convenience. |
| 458 | */ |
| 459 | export async function hasCredentialSetsAccess(userId: string): Promise<boolean> { |
| 460 | try { |
| 461 | if (isCredentialSetsEnabled && !isHosted) { |
| 462 | return true |
| 463 | } |
| 464 | |
| 465 | return isTeamOrgAdminOrOwner(userId) |
| 466 | } catch (error) { |
| 467 | logger.error('Error checking credential sets access', { error, userId }) |
| 468 | return false |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | /** |
| 473 | * Check if user has access to SSO feature |