2022-06-01 15:05:33 +00:00
|
|
|
import { UserPermissionRole } from "@prisma/client";
|
|
|
|
|
2022-05-31 16:33:01 +00:00
|
|
|
import prisma from "@calcom/prisma";
|
|
|
|
|
|
|
|
export const isAdminGuard = async (userId: number) => {
|
|
|
|
const user = await prisma.user.findUnique({ where: { id: userId } });
|
2022-05-31 18:46:09 +00:00
|
|
|
return user?.role === UserPermissionRole.ADMIN;
|
2022-05-31 16:33:01 +00:00
|
|
|
};
|