Repository navigation
fix(admin): open each screen to its own role, proved by the M4 exit-gate browser specs - #167
Merged
Merged
Conversation
…ate browser specs Three browser specs demonstrate the M4 exit gate against a test-only simulated Mailchimp: - m4-journey: a new operator goes from the onboarding checklist through a template published in the block editor, a Mailchimp campaign, review, approval, provider draft, test, guarded schedule and send confirmations, and reconciliation to sent, with one provider request of each kind. - role-matrix: author, manager, approver, deliverer, and a user without CampaignBridge capabilities each see only their data, menus, buttons, and published actions under separation of duties. - campaign-states: axe-clean empty, loading, offline, review, stale, and denied states; keyboard-only creation; reduced motion; and a pseudo-locale proving every string is translatable and script translations arrive. A second test-only mu-plugin creates throwaway operators with exact capabilities and serves the pseudo-locale; CI installs both test plugins. The matrix found defects, fixed here with regression tests: - A template author who was not a WordPress editor was refused the template editor. WordPress authorizes a post type shown under another plugin's menu against Posts -> Add New, and screens it cannot match against the top-level menu, which required the management capability. The menu now uses the first CampaignBridge capability the user holds, and the new-template screen has its own entry. - Screens offered edit, snapshot, submit, approve, and duplicate to users without access to the campaign's template, which the workflow then refused. Actions now follow template access. - Users without template access saw the menu title repeated as a submenu. - Every screen controller was built on each admin request, so the settings controller checked the Mailchimp key from unrelated pages. Controllers are now built only for their own screen. The simulator now answers the connection check only for its own key, so a real key on a development site is never marked verified by a fake answer. ROADMAP records how the M4 exit gate is met. Closes #155 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tings page CI's disposable site uses plain permalinks, so the outsider's request to /wp-json/ returned the home page with 200 instead of reaching the REST API; it now uses ?rest_route=, which works with either. Saving the delivery policy left the admin page on Settings, which does not load wp.apiFetch, so the following API calls (and cleanup after a retry) failed; the helper now returns to the Campaigns screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 tasks done
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.
Closes #155. Completes #65 (M4).
Exit-gate evidence
Three browser specs run in CI against the test-only simulated Mailchimp, so no real email is sent.
m4-journey.spec.ts: a brand-new operator goes from first run to a reconciled send entirely in the UI:sent.Exactly one provider request of each kind is made, and the history records every step.
role-matrix.spec.ts: with separation of duties on, five roles each see only their own data, menus, buttons, and publishedactions:campaign-states.spec.ts:A second test-only mu-plugin (
campaignbridge-e2e-operators.php) creates throwaway users with exact CampaignBridge capabilities and serves the pseudo-locale. CI now installs both test plugins. Neither ships in the release package.Defects the matrix found (fixed, with regression tests)
edit_posts). It authorizes screens it can't match against the top-level menu, which requiredcampaignbridge_manage.Admin_Screens_Testbuilds the real admin menu and checksuser_can_access_admin_page()for a template-only user; without either fix the test fails.Campaign_Actionsnow follows template access. This is covered by a unit test and a REST wiring test.Other changes
/pingonly for its own fake key. A development site's real key gets Mailchimp's real answer, never a fake "verified". The fake key is built at runtime so it can't trigger secret scanning.api.md(template-gated actions),runbook.md(when the connection check runs), andtesting-strategy.mdare updated.Verification
pnpm qa:fastandpnpm buildpass.🤖 Generated with Claude Code