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

Function createPermission

packages/testing/src/factories/permission.factory.ts:40–49  ·  view source on GitHub ↗
(options: PermissionFactoryOptions = {})

Source from the content-addressed store, hash-verified

38 * Creates a mock permission record.
39 */
40export function createPermission(options: PermissionFactoryOptions = {}): Permission {
41 return {
42 id: options.id ?? shortId(8),
43 userId: options.userId ?? `user-${shortId(6)}`,
44 entityType: options.entityType ?? 'workspace',
45 entityId: options.entityId ?? `ws-${shortId(6)}`,
46 permissionType: options.permissionType ?? 'read',
47 createdAt: options.createdAt ?? new Date(),
48 }
49}
50
51/**
52 * Creates a workspace admin permission.

Callers 3

createAdminPermissionFunction · 0.85
createWritePermissionFunction · 0.85
createReadPermissionFunction · 0.85

Calls 1

shortIdFunction · 0.90

Tested by

no test coverage detected