1
0
Fork 0
polaris-task-force/src/collections/Shims.ts
Z8MB1E 653caa8064 feat(rbac): migrate collection access controls to RBAC permissions
Replace legacy isDeveloper/isAdmin/hasRoles checks with
hasPermission/requirePermission across all collections. Add roleDocs
relationship to Users, enlistmentDate to Profiles, and field-level
intel_excerpt permission gate on Profiles. Auto-generated payload-types
updated to reflect the new Roles collection and roleDocs field.
2026-08-19 19:47:51 -04:00

40 lines
827 B
TypeScript

import { GlobalConfig } from "payload";
import { requirePermission } from "@/utils/access-control/hasPermission";
export const Shims: GlobalConfig = {
slug: "shims",
access: {
update: requirePermission("shims:update"),
read: requirePermission("shims:read"),
},
fields: [
{
name: "shims",
type: "array",
fields: [
{
name: "name",
type: "text",
required: true,
unique: true,
},
{
name: "summary",
type: "text",
},
{
name: "content",
type: "code",
required: true,
},
{
name: "type",
type: "select",
options: ["css", "js"],
required: true,
defaultValue: "css",
},
],
},
],
};