MCPcopy Create free account
hub / github.com/code100x/cms / isAdmin

Function isAdmin

src/actions/event-actions/index.ts:10–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import { revalidatePath } from 'next/cache';
9
10async function isAdmin() {
11 const session = await getServerSession(authOptions);
12 const adminEmails = process.env.ADMINS?.split(',') || [];
13 return session?.user?.email && adminEmails.includes(session.user.email);
14}
15
16export async function fetchEvents() {
17 return await prisma.event.findMany();

Callers 3

addEventFunction · 0.85
updateEventFunction · 0.85
deleteEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected