MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / isCommitteeLead

Function isCommitteeLead

server/src/routes/content.ts:313–322  ·  view source on GitHub ↗

* Check if user is a committee lead (handles both WorkOS and Slack user IDs)

(committeeId: string, userId: string)

Source from the content-addressed store, hash-verified

311 * Check if user is a committee lead (handles both WorkOS and Slack user IDs)
312 */
313async function isCommitteeLead(committeeId: string, userId: string): Promise<boolean> {
314 const pool = getPool();
315 const result = await pool.query(
316 `SELECT 1 FROM working_group_leaders wgl
317 LEFT JOIN slack_user_mappings sm ON wgl.user_id = sm.slack_user_id AND sm.workos_user_id IS NOT NULL
318 WHERE wgl.working_group_id = $1 AND (wgl.user_id = $2 OR sm.workos_user_id = $2)`,
319 [committeeId, userId]
320 );
321 return result.rows.length > 0;
322}
323
324/**
325 * Get user info for author display

Callers 4

proposeContentForUserFunction · 0.85
approveContentForUserFunction · 0.85
rejectContentForUserFunction · 0.85
createMyContentRouterFunction · 0.85

Calls 2

getPoolFunction · 0.85
queryMethod · 0.80

Tested by

no test coverage detected