Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

437 B
Raw Blame
import {
  ALL_PROJECTS_ACCESS,
  type ProjectAccessValue,
} from "./project-access-value";

export function findMemberProjectAccess(
  entries: readonly { userId: string; projectIds: string[] }[] | undefined,
  userId: string,
): ProjectAccessValue {
  const entry = entries?.find((candidate) => candidate.userId === userId);
  return entry
    ? { projectAccess: "selected", projectIds: entry.projectIds }
    : ALL_PROJECTS_ACCESS;
}