import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; // NOTE: The emulator's standalone `permissions` table is not present in the // Prisma schema (there is no `prisma.permissions` accessor). The real, // queryable rank-permission table in this schema is `website_housekeeping_permissions` // (model WebsiteHousekeepingPermissions), which gates each permission by the // minimum rank that holds it — exactly the rank-permission data this page lists. type PermissionRow = { id: bigint; permission: string; minRank: number; description: string | null; }; export default async function AdminPermissions() { let permissions: PermissionRow[] = []; try { permissions = await prisma.websiteHousekeepingPermissions.findMany({ select: { id: true, permission: true, minRank: true, description: true }, orderBy: [{ minRank: "asc" }, { permission: "asc" }], }); } catch { permissions = []; } return (

Permissions

Read-only view of rank permissions. Each entry is the minimum rank that grants the permission.

{permissions.length === 0 ? (

No permissions found.

) : ( {permissions.map((p) => ( ))}
ID Permission Min rank Description
{String(p.id)} {p.permission} {p.minRank} {p.description ?? "—"}
)}
); }