( userId: string, workspaceId: string )
| 384 | * @returns Promise<boolean> - True if the user has admin access to the workspace, false otherwise |
| 385 | */ |
| 386 | export async function hasWorkspaceAdminAccess( |
| 387 | userId: string, |
| 388 | workspaceId: string |
| 389 | ): Promise<boolean> { |
| 390 | const ws = await getWorkspaceWithOwner(workspaceId) |
| 391 | |
| 392 | if (!ws) { |
| 393 | return false |
| 394 | } |
| 395 | |
| 396 | return (await getEffectiveWorkspacePermission(userId, ws)) === 'admin' |
| 397 | } |
| 398 | |
| 399 | /** |
| 400 | * Check whether a user is an owner or admin of a specific organization. |
no test coverage detected