Skip to content

Commit

Permalink
fix: admin should see all routing forms (Router position) (calcom#18931)
Browse files Browse the repository at this point in the history
Co-authored-by: CarinaWolli <[email protected]>
  • Loading branch information
CarinaWolli and CarinaWolli authored Jan 28, 2025
1 parent 8f8af65 commit fa82ecd
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/features/insights/server/virtual-queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,28 @@ class VirtualQueuesInsights {
INNER JOIN "users" u ON f."userId" = u.id
WHERE e."schedulingType" = 'roundRobin'
AND e."isRRWeightsEnabled" = true
AND EXISTS (
AND (
EXISTS (
SELECT 1
FROM "Host" h
WHERE h."eventTypeId" = e.id
AND h."userId" = ${userId}
);
)
OR EXISTS (
SELECT 1
FROM "Membership" m
WHERE m."teamId" = f."teamId"
AND m."userId" = ${userId}
AND m.role = 'ADMIN'
)
OR EXISTS (
SELECT 1
FROM "Membership" m
WHERE m."teamId" = t."parentId"
AND m."userId" = ${userId}
AND m.role = 'ADMIN'
)
)
`;

// Convert the raw forms to serializable format
Expand Down

0 comments on commit fa82ecd

Please sign in to comment.