Repository navigation
Add a System nav item for the system admin and move All organizations there - #51
Merged
Merged
Conversation
… there Platform-level views get their own page, /system, instead of riding on the Organization page as a card only one account could see. The nav draws the System link for the system admin alone (/api/orgs now says who); the page redirects everyone else to their dashboard, and its read, /api/system/state, answers 403. It holds platform totals and the All organizations table with the create and delete controls that were on /admin. /api/admin/state no longer carries the platform list. The fake system database learns the grouped member-count query all_orgs runs, which no test had exercised before.
| return | ||
| if self._gated_on_verify(viewer, path): | ||
| return | ||
| if not self.auth.is_system_admin(viewer["email"]): |
There was a problem hiding this comment.
nit: Add the org_slug check that /admin has at line 2947, before the system admin check. (not blocking)
A system admin with no organization gets system.html from this route. /api/system/state then answers 409 from the shared org_slug gate at line 3035, so the page shows only an error banner. The fix is to redirect to /setup?next=... here, the same way /admin does.
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.
A new top-level System nav item, shown only to the system admin, leading to
/system: the home for platform-level views. It holds platform totals (organizations, members, empty organizations) and the All organizations table with its create and delete controls, moved off the Organization page so that page is about one team only./systemredirects non-system-admins to/;/api/system/stateanswers 403 to them and 401 to tokens and strangers./api/orgsgainsisSystemAdmin, which the nav uses to draw the link./api/admin/stateno longer includesallOrgs.Tests: new
server/tests/test_system.py(gates, totals, nav gating),/systemand/api/system/stateadded to the read-token refusal list. All suites pass.