MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / isAdmin

Function isAdmin

app/src/utils/accessControl.ts:6–12  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

4import { prisma } from "~/server/db";
5
6const isAdmin = async (userId: string) => {
7 const user = await prisma.user.findFirst({
8 where: { id: userId, role: "ADMIN" },
9 });
10
11 return !!user;
12};
13
14const requireUserId = (ctx: TRPCContext) => {
15 if (!ctx.session?.user.id) {

Callers 1

requireIsAdminFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected