Org admin area routing changes
What does this MR do and why?
Restructures admin routing to separate the instance admin and organization admin areas:
/admin/*is instance administration and is excluded from the organization scope, so it always resolves to instance administration./o/:org_path/adminserves the organization admin dashboard, including for the default organization.
Admin routes are split into dedicated route files (config/routes/instance_admin.rb and config/routes/organization_admin.rb), and config/routes/admin.rb draws the correct set based on whether the request is organization-scoped. This keeps /admin/* out of the /o/:org_path scope entirely.
Admin URL helpers switch to the organization-scoped path whenever there is a current organization (including the default organization), so shared admin controllers and views generate the correct path in both admin areas. Instance admin routes have no organization-scoped variant, so their helpers always generate unscoped /admin/* paths.
Route summary
| Route | Controller | Purpose |
|---|---|---|
/admin |
admin/dashboard#index |
Instance admin dashboard |
/admin/* |
various admin/* |
Instance administration (excluded from org scope) |
/o/:org_path/admin |
admin/organizations/dashboard#index |
Org admin dashboard (incl. default org) |
Related MRs
This work is decomposed from !226689 (closed) and sits on top of the admin organization context stack.
Stacked:
- !247881 (merged) – Centralize admin area organization resolution (targets
master) - !247426 (merged) – Separate instance and organization admin contexts (targets
dblessing_admin_current_organization_refactor, the branch of 1) - !244408 (merged) – Org admin area routing changes
⬅️ you are here (targetsorg-scoped-admin-permissions, the branch of 2)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist.
Testing
- Visit the instance admin area and note that it works as expected with the feature flag disabled.
- Try to visit the default org admin and note the 404
- Enable the
org_stage_experimentalfeature flag. - Visit various admin area URLs directly to see that they work as expected.
- https://gdk.test:3443/admin - This should be the instance admin area as it's always been.
- https://gdk.test:3443/o/default/admin - This should be the shell for the default organization admin area.
- Create a new organization, or use an existing organization. Visit that org's admin area - it will also be just a placeholder shell. https://gdk.test:3443/o/acme/admin
References
This is part of a decomposed MR from !226689 (closed).