(options: PermissionFactoryOptions = {})
| 38 | * Creates a mock permission record. |
| 39 | */ |
| 40 | export 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. |
no test coverage detected