mirror of
https://github.com/coder/coder.git
synced 2026-11-09 14:34:47 +08:00
24 lines
477 B
TypeScript
24 lines
477 B
TypeScript
export const workspacePermissionChecks = (
|
|
organizationId: string,
|
|
userId: string,
|
|
) =>
|
|
({
|
|
createWorkspaceForUserID: {
|
|
object: {
|
|
resource_type: "workspace",
|
|
organization_id: organizationId,
|
|
owner_id: userId,
|
|
},
|
|
action: "create",
|
|
},
|
|
}) as const;
|
|
|
|
export type WorkspacePermissions = Record<
|
|
keyof ReturnType<typeof workspacePermissionChecks>,
|
|
boolean
|
|
>;
|
|
|
|
export type WorkspacePermissionName = keyof ReturnType<
|
|
typeof workspacePermissionChecks
|
|
>;
|