MCPcopy Index your code
hub / github.com/simstudioai/sim / hasWorkspaceAdminAccess

Function hasWorkspaceAdminAccess

apps/sim/lib/workspaces/permissions/utils.ts:386–397  ·  view source on GitHub ↗
(
  userId: string,
  workspaceId: string
)

Source from the content-addressed store, hash-verified

384 * @returns Promise<boolean> - True if the user has admin access to the workspace, false otherwise
385 */
386export 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.

Callers 10

utils.test.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls 2

getWorkspaceWithOwnerFunction · 0.85

Tested by

no test coverage detected