Repository navigation
🐛 Fixed broken admin views for Contributor and Author staff users - #29653
Conversation
ref #26607 - a deep link to a route the role can't use (settings, tags, members, comments, automations) left staff users on a route that rendered nothing; for settings that meant a transparent full-screen overlay swallowing every click on the admin shell behind it - added a route-level access guard: routes declare the access their role needs via handle.requiresAccess, denied users are sent to their default view - the redirect is a cross-app navigation so Ember's home route resolves the role-specific landing page instead of parking on / - Authors and Contributors still reach their own profile at settings/staff/:slug, which is where /my-profile sends them - replaces the one-off guard that only covered the members route
no ref - Authors and Contributors open their own profile as a full-bleed page rather than a modal, but only the form was width-constrained, so the header spread edge to edge and the Close/Save buttons sat in the far corner of the viewport - header, form and footer now share one column - the cover-image band no longer reserves 30vmin of empty space above the avatar when the user has no cover image - SettingsModal takes an optional footerClassName for the width cap; it is unset for every other caller, so the modal layout is unchanged
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 6m 44s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin-x-s... |
✅ Succeeded | 2m 23s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 21s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 18s | View ↗ |
nx run-many -t lint -p @tryghost/admin-x-settin... |
✅ Succeeded | 1m 5s | View ↗ |
nx run @tryghost/activitypub:test:acceptance |
✅ Succeeded | 42s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
nx run ghost-admin:test |
✅ Succeeded | 2s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-28 19:04:12 UTC
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughAdmin routing now applies Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29653 +/- ##
==========================================
- Coverage 75.44% 75.44% -0.01%
==========================================
Files 1606 1606
Lines 141107 141103 -4
Branches 17455 17454 -1
==========================================
- Hits 106465 106461 -4
Misses 33598 33598
Partials 1044 1044
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
no ref - the access rule for settings/* whitelisted the profile tab paths, duplicating the modal path table the settings router owns; adding a tab there would have rendered it for admins and redirected everyone else - both now derive from one list, so a new tab is a single edit - the list lives in a leaf module with no imports, keeping it out of the lazy settings chunk the admin shell loads it ahead of

Deep-linking to a route your role can't use left Contributors and Authors on a route that rendered nothing. For
settings/*that was worse than a blank page: the settings surface portals aposition: absolute; inset: 0; z-index: 20div intodocument.bodyfor the whole lifetime of the route match, while its contents are conditional on role. Route matched, nothing rendered — a transparent full-viewport layer sat over an admin shell that looked completely normal and swallowed every click.ref #26607
Route access layer
Routes now declare the access their role needs, and a single guard enforces it:
RouteAccessGuardcollectshandle.requiresAccessfrom every match and redirects when any rule fails. A route with no rule is unguarded, so the current user is only awaited where a rule exists. Rules mirror the sidebar's existing visibility gating exactly — tags, comments, members, automations, settings — so nothing that was reachable from the nav becomes unreachable.The redirect is a cross-app navigation. The home route is Ember-owned and picks the landing view per role (admin → analytics, contributor → posts, else site); a plain React
Navigate to="/"never reaches Ember's router, so the user parks on/instead of landing where a hard nav would take them.Settings can't be a plain role check: Authors and Contributors legitimately live at
settings/staff/:slug, which is where/my-profilesends them. The rule allows settings access, or that user's own profile path and its tabs; everything else redirects.This replaces the one-off guard that only covered the members route.
Profile page layout
Roles without settings access open their profile full-bleed rather than as a modal, but only the form was width-constrained — the header spread edge to edge and Close/Save sat in the far corner of the viewport. Header, form and footer now share one column, and the cover-image band no longer reserves 30vmin of empty space above the avatar when there's no cover image.
SettingsModalgained an optionalfooterClassNamefor the width cap. It's unset for every other caller, so the modal layout is untouched.Not included
/analyticsand/posts/analytics/:postIdare left ungated. Gating analytics onhasAdminAccesswould match the sidebar, but it would also redirect Editors arriving by an existing link, and there's no predicate for post-level analytics — Authors arguably should see their own. That's a product call worth making separately.Testing
/settings/design, Author at another user's profile, Contributor at/tags, Editor at/membersall hand off to home; a Contributor stays on their own profile; an authorized user stays put.tsc -bclean; 1077 unit tests, 381 admin acceptance tests, 235 shade tests pass.