import { createPermission, deletePermission, updatePermission, } from "@/actions/admin-permissions"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; // Manages website_permissions (model WebsitePermissions) — the CMS-owned // rank-permission mapping AtomCMS exposes in admin. Each row is a key with an // optional value and comment; those are the only editable columns on the table. type PermissionRow = { id: bigint; key: string; value: string | null; comment: string | null; }; export default async function AdminPermissions() { let permissions: PermissionRow[] = []; try { permissions = await prisma.websitePermissions.findMany({ select: { id: true, key: true, value: true, comment: true }, orderBy: { key: "asc" }, take: 500, }); } catch { permissions = []; } return (

Permissions

CMS-owned rank permissions (website_permissions). Each entry maps a permission key to its value/name and an optional comment.

Add / overwrite permission

{permissions.length === 0 ? (

No permissions found.

) : ( {permissions.map((p) => ( ))}
ID Key Value Comment
{String(p.id)}
)}
); }