diff --git a/src/app/(app)/policies/[code]/edit/page.tsx b/src/app/(app)/policies/[code]/edit/page.tsx index 1a36337..fbf247b 100644 --- a/src/app/(app)/policies/[code]/edit/page.tsx +++ b/src/app/(app)/policies/[code]/edit/page.tsx @@ -9,9 +9,10 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Pill } from "@/components/mockup-ui"; import { applyProtection, buildContext, effectiveLevel, renderPolicyHtml, splitPolicyDoc } from "@/lib/policy-render"; +import { isCentralVariable } from "@/lib/policy-variables"; import { POLICY_STATUS_LABEL, POLICY_STATUS_TONE, POLICY_TYPE_LABEL } from "@/components/policy-modals"; import { PolicyExpertEditor } from "@/components/policy-expert-editor"; -import { approvePolicy, rejectPolicy, setProtectionOverride, submitForApproval, updatePolicyTemplate, updateScopedVariables } from "@/server/actions/policies"; +import { approvePolicy, rejectPolicy, submitForApproval, updatePolicyTemplate, updateScopedVariables } from "@/server/actions/policies"; const TEMPLATE_TYPES = new Set(["LEITLINIE", "RICHTLINIE", "VERFAHREN"]); @@ -59,12 +60,14 @@ export default async function PolicyEditPage({ const userName = (id: string | null) => users.find((u) => u.id === id)?.name ?? id ?? "—"; const usedKeys = docVariableKeys(doc.rawMarkdown, baseline); - const docVars = variables.filter((v) => usedKeys.has(v.key) && v.kind !== "boolean"); + // Zentrale Variablen (Organisation/Rollen) sind nur in den Einstellungen pflegbar → hier ausblenden. + const docVars = variables.filter((v) => usedKeys.has(v.key) && v.kind !== "boolean" && !isCentralVariable(v)); const keysCsv = docVars.map((v) => v.key).join(","); - const ctx = applyProtection(buildContext(variables), doc.protectionOverride); + // Schutzbedarf wird zentral gesteuert (Superadmin) — kein Override je Richtlinie mehr. + const ctx = applyProtection(buildContext(variables)); const globalVeryHigh = variables.find((v) => v.key === "FLAG_VERY_HIGH_PROTECTION")?.value === "true"; - const effLevel = effectiveLevel(globalVeryHigh, doc.protectionOverride); + const effLevel = effectiveLevel(globalVeryHigh); const { infoMd, bodyMd } = splitPolicyDoc(doc.rawMarkdown); const stripBaseline = doc.code !== "BASELINE"; const bodyHtml = renderPolicyHtml(bodyMd, ctx, { readMode: true, stripBaseline }); @@ -182,25 +185,18 @@ export default async function PolicyEditPage({
{t("approvalNote")}
- {/* Schutzbedarf / TISAX-Level-Override je Richtlinie (Delta-Update) */} -