Resolves whether the user may access the workspace, swallowing errors to a `false`.
(workspaceId: string, userId: string)
| 12 | |
| 13 | /** Resolves whether the user may access the workspace, swallowing errors to a `false`. */ |
| 14 | async function userCanAccessWorkspace(workspaceId: string, userId: string): Promise<boolean> { |
| 15 | try { |
| 16 | const access = await checkWorkspaceAccess(workspaceId, userId) |
| 17 | return access.exists && access.hasAccess |
| 18 | } catch { |
| 19 | return false |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Prefetches the sidebar's workflow + chat lists for a workspace and stores them |
no test coverage detected