MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getClientAccess

Function getClientAccess

packages/db/src/services/access.service.ts:61–90  ·  view source on GitHub ↗
({
  userId,
  clientId,
}: {
  userId: string;
  clientId: string;
})

Source from the content-addressed store, hash-verified

59);
60
61export async function getClientAccess({
62 userId,
63 clientId,
64}: {
65 userId: string;
66 clientId: string;
67}) {
68 const client = await db.client.findFirst({
69 where: {
70 id: clientId,
71 },
72 });
73
74 if (!client) {
75 return false;
76 }
77
78 if (client.projectId) {
79 return getProjectAccess({ userId, projectId: client.projectId });
80 }
81
82 if (client.organizationId) {
83 return getOrganizationAccess({
84 userId,
85 organizationId: client.organizationId,
86 });
87 }
88
89 return false;
90}

Callers 1

client.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected