From 83ae3a08ffe5cb64666bb3cab6abf94fcc2c757b Mon Sep 17 00:00:00 2001 From: Geoff Moore <84508186+GeoffMoore1979@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:11:06 +0100 Subject: [PATCH 1/2] feat: lock pages against editor changes Administrators can lock a page from the Pages list to stop editors publishing, saving a draft, or scheduling a change to it. Administrators are never restricted by a lock. State is stored per-page URI in the new cms/data/pagelocks.json, following the existing pagetemplates.json pattern: it moves with the page on rename, is cleared on delete, and is never copied onto a duplicate. - New lockPageAction and assertNotLockedForEditor() guard, called from save/saveDraft/schedule. - getPages responses gain a locked flag; the Pages list gets a Lock/ Unlock row action and a Locked badge. Co-Authored-By: Claude Sonnet 5 --- cms/css/editor.css | 1 + cms/js/cms.js | 10 +++++++ cms/src/NeoCMS/CMSController.php | 48 +++++++++++++++++++++++++++++++- docs/ARCHITECTURE.md | 1 + tests/run.php | 14 ++++++++++ 5 files changed, 73 insertions(+), 1 deletion(-) diff --git a/cms/css/editor.css b/cms/css/editor.css index 415cee1..d251e0c 100644 --- a/cms/css/editor.css +++ b/cms/css/editor.css @@ -435,6 +435,7 @@ body { margin-left: 10px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #fff3d6; color: #8a5a00; border: 1px solid #f0d58a; } +.badge-locked { background: #fde2e1; color: #8a1f1f; border-color: #f3b4b2; } @media (max-width: 700px) { #fileList .page-title, #fileList th:nth-child(2), #fileList .page-date, #fileList th:nth-child(3) { display: none; } } /* Site scan progress bar and file count. */ diff --git a/cms/js/cms.js b/cms/js/cms.js index a89a23d..e8c9bfd 100644 --- a/cms/js/cms.js +++ b/cms/js/cms.js @@ -447,6 +447,7 @@ const name = $('').append(docIcon()); $('