Repository navigation
Conversation
The Send to CMS route now refuses a manager when an admin turned Publishing off for managers in Settings › Chat (chat_settings.manager_execute_off), with the code execute_off, as Chat's own send does. Admins are unaffected; a failed read of the switch refuses the send. The editor's and Library's send dialogs show the reason, the Settings › Chat note and the Send to CMS help page say the switch covers these sends.
gkhngyk
pushed a commit
that referenced
this pull request
Nov 4, 2026
…tly routes to admins and managers A re-audit of the server's write routes on 2026-11-03 found 15 that start paid or AI work, delete, or decide for the workspace without a role check. Each now refuses an analyst or an agency partner with 403 forbidden before anything runs, is queued, bought or deleted: - tracking: /check, /analyze-new (Run now) and stopping a run; - volumes: /analyze, /analyze-batch, /bootstrap, /refresh; - audits: deleting one; - competitors: /suggest; - brand facts: reading the site again, approving or rejecting a fact; - prompts: /from-topics; - content: sending opportunities to the webhook, one or in bulk; - Action Center: Regenerate tasks (a model writes them). allowRole() in lib/access.js answers the 403 itself, for routes whose catch answers 500. Reading volumes, the reports summary, the Fan-out tab's intents and publishing (#1894) stay as they are. The web hides what the server now refuses: Run All and Test Single Prompt, stopping a run, the volume buttons, Analyze Prompts, an audit's delete, Send to Workflow and Send All (and so the bulk boxes), Regenerate tasks, and the Brand facts tab's Approve, Reject and Read again, with a line on who does it. The Help articles say who can. Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
pushed a commit
that referenced
this pull request
Nov 4, 2026
…s why it is open routes/write-roles.test.js reads every POST, PUT, PATCH and DELETE route mounted in routes/index.js (the signed-in person's /api) and fails when its handler calls no role check: assertRole() or allowRole(), a roles list such as MANAGER_ROLES, a read of profile.role, or a function of its own route file (or one it imports from another route file) that does one. Routes open to every member are listed in OPEN, each with its reason: Action Center work, running a Site Audit, Content Editor writing, reads such as the Fan-out tab's intents and the reports summary, the demo brand, and publishing, whose rule #1894 decides. A listed route that checks the role, or is gone, fails too, so the list stays true. The webhooks, callbacks, beacon and internal endpoints are mounted in server.js and answer to a secret or a signature, so they aren't read. CONTRIBUTING.md gets a Roles section: who does what, and what a new write route needs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
9 of 13 tasks
Contributor
Author
|
Closing: main already covers this. The Content Editor and Library sends check the Managers' publishing switch in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Settings › Chat has an Admin switch under What Managers may take live: turning Publishing off for Managers (
chat_settings.manager_execute_off, migration 00401). Until now only Chat read it, so a Manager could still send the same page from the Content Editor or the Library. This PR makes Send to CMS respect the switch too.POST /api/content-drafts/send(server): after the existing admin/manager role check, a Manager is refused with403and codeexecute_offwhen the brand's workspace haspublishinginmanager_execute_off. Admins skip the read. If the setting can't be read, the send is refused (502 failed), the same fail-closed behavior Chat's send uses. Roles below Manager were already refused (forbidden), and that doesn't change.execute_offis now one of the known send errors incms-send-client.ts, so the editor's Send dialog and the Library's bulk send dialog show "An admin turned publishing off for managers, so only an admin can send pages to the CMS." instead of a general failure.help/content/send-to-cms.mdsays Managers can send only while Publishing is on for them.Other paths checked: the MCP and internal "mark published" endpoints only record a live URL that already exists (open to any member, and nothing goes to a CMS). Opportunity and task "send to webhook" hand work to a workflow and don't send drafts to a CMS. Neither path changes. The Send button stays visible: the editor and Library don't gate it by role today, so the refusal message comes from the server.
Related issue
Follow-up to #1868 (Chat's CMS send checks the same switch). This PR doesn't depend on it, because the switch already exists on
main.Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
server:npx vitest run src/routes/content-drafts-send.test.js(Manager-off, Manager-on, Admin-off, and a failed read).web:npx vitest run src/lib/content/cms-send-client.test.ts src/components/content/send-to-cms-dialog.test.tsx "src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.test.tsx".Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)help/(or no user-visible change) — see help/README.md🤖 Generated with Claude Code