- Add commandAssignments and intelAssignments to GameRules global - Implement role-based read access for missions (developer, admin, command, intel) - Add visibility levels: unit, leadership, intel, private - Restrict draft missions to authors, zeus, command, and intel - Change faction field from text to relationship in missions - Make missionFile optional in game setup
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { GlobalConfig } from "payload";
|
|
import { isDeveloper } from "@/utils/access-control/isRole";
|
|
|
|
export const GameRules: GlobalConfig = {
|
|
slug: "game-rules",
|
|
access: {
|
|
read: isDeveloper,
|
|
update: isDeveloper,
|
|
},
|
|
fields: [
|
|
{
|
|
name: "mainCurrency",
|
|
type: "relationship",
|
|
relationTo: "resources",
|
|
required: true,
|
|
admin: {
|
|
description:
|
|
'The base currency ("gold standard") used by all factions to pay for goods and services.',
|
|
},
|
|
},
|
|
{
|
|
name: "commandAssignments",
|
|
type: "relationship",
|
|
relationTo: "assignments",
|
|
hasMany: true,
|
|
admin: {
|
|
description:
|
|
"Assignment(s) considered unit command. Members and leaders of these assignments get elevated access to draft missions and other restricted content.",
|
|
},
|
|
},
|
|
{
|
|
name: "intelAssignments",
|
|
type: "relationship",
|
|
relationTo: "assignments",
|
|
hasMany: true,
|
|
admin: {
|
|
description:
|
|
"Assignment(s) considered the intelligence division. Members and leaders of these assignments get elevated access to draft missions and intelligence content.",
|
|
},
|
|
},
|
|
],
|
|
};
|