Add approval workflow enforcement for page creation by editors #22
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Public/noodlenook!22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/add-approval-workflow-restriction"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When approval workflow is enabled, editors can now edit existing pages (requiring approval), but they could still create new published pages directly, bypassing the workflow entirely.
Changes
Backend (
routes/pages.js)POST /to check approval workflow setting and create pages withis_published = falsefor editors when enabledGET /unpublished/list- returns unpublished pages (admins see all, editors see own)POST /:slug/publish- admin-only endpoint to publish pending pagesPOST /:slug/reject- admin-only endpoint to reject and delete pending pagesGET /:slugvisibility logic: admins see all pages, editors see published + own unpublished, viewers see published onlyFrontend
UnpublishedPages.jsx- new component for reviewing/approving pending pagesPageEditor.jsx- added handling forrequires_approvalresponse flag with user feedbackHeader.jsx- added "Unpublished" navigation buttonapi.js- addedgetUnpublished(),publish(),reject()methodsExample flow:
Permission Matrix
Admins bypass approval workflow; their pages publish immediately regardless of setting.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.