Repository navigation
Organisation page: say why the roster is missing, and offer only the controls the hub accepts - #21
Merged
Merged
Conversation
…controls the hub accepts Creating an organisation in Settings led to a page with nothing on it: the token in use was issued before the organisation existed, so it does not name it, and the roster answers 403 to such a token. The page now says so when the signed-in token does not name the organisation, and links to Settings with the token form naming the caller and the organisation. The line is the same for a member and a stranger; it says what a token needs, not who is in the organisation. Straight after creating an organisation, Settings fills the same form in and its notice says what has to happen first, instead of pointing at a page that cannot show anything yet. Once a token does name the organisation, the member controls appeared for any token that could write there, while the hub asks admin on the organisation -- the lesser of the token's scope and the caller's role -- for adding and removing members. They now appear only for an admin token of an admin member, read from the roster; everyone else sees the roster and a line saying what managing it takes. Closes #19. Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
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 #19.
UI only; no API change.
The empty page after creating an organisation
The token in use was issued before the organisation existed, so it does not name it, and
GET /orgs/{org}/membersanswers403to it./ns/{org}rendered nothing in that case. It now says, for a signed-in token that does not name the organisation: its members are not shown, a member sees them with a token that names it, and a link to/settings?ns={org}issues one. The line is the same for a member and a stranger — it says what a token needs, not who is in the organisation. An anonymous visitor sees what they saw before.No typing of the slug
Settings fills the "Issue a token" namespaces field with
<login>, <org>in two places: right after creating an organisation on the same screen, and when arriving from the link above (?ns=). The success notice no longer says "Manage members on its page"; it says the current token does not name the organisation, that the form is filled in, and that managing members takes anadmintoken.Member controls only where the hub accepts them
canManagewasmembers !== null && session.mayWrite(ns), so awritetoken naming the organisation got the add form and theremovebuttons, whichadd_member/remove_memberanswer with403(they askadminon the organisation: the lesser of the token's scope and the caller's role). They now appear only when the token's scope isadminand the caller's row in the roster isadmin. Everyone else sees the roster and a line saying what managing it takes.Verification
just web-check(svelte-check 0 errors, prettier clean) andjust e2e: 18 passed, 0 failed, including the browser suite (5 passed).web/tests/browser/orgs.spec.ts:alice, <org>; the token is issued without typing the namespaces; after signing in with it the hint is gonewritetoken naming the organisation shows the roster (alice as admin) with no add form, noremovebuttons, and the line about adminNo Rust changes;
cargochecks not run.