-
Notifications
You must be signed in to change notification settings - Fork 4
Make org roles explicit in membership #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
9264e7c
to
89c6fe9
Compare
fetch "$transcripts_user" POST org-add-members '/orgs/acme/members' '{ | ||
"members": [ | ||
"test" | ||
{ "subject": "test", | ||
"roles": "org_maintainer" | ||
} | ||
] | ||
}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hojberg Here's the new /orgs/<handle>/members
POST format, subject
is a user handle, roles
in this case is a single role ref.
"members": [ | ||
{ | ||
"avatarUrl": null, | ||
"handle": "newuser", | ||
"name": null, | ||
"userId": "U-<UUID>" | ||
"roles": "org_maintainer", | ||
"subject": { | ||
"avatarUrl": null, | ||
"handle": "test", | ||
"name": null, | ||
"userId": "U-<UUID>" | ||
} | ||
}, | ||
{ | ||
"avatarUrl": null, | ||
"handle": "test", | ||
"name": null, | ||
"userId": "U-<UUID>" | ||
}, | ||
{ | ||
"avatarUrl": "https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?f=y&d=retro", | ||
"handle": "transcripts", | ||
"name": "The Transcript User", | ||
"userId": "U-<UUID>" | ||
"roles": "org_owner", | ||
"subject": { | ||
"avatarUrl": "https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?f=y&d=retro", | ||
"handle": "transcripts", | ||
"name": "The Transcript User", | ||
"userId": "U-<UUID>" | ||
} | ||
} | ||
] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the new response for the 'members' endpoint, it includes the user's role.
Overview
NOTE: requires co-ordination with frontend and a migration in order to deploy
Previously, org memberships and a user's role(s) within the org were separate concepts which added a lot of confusion and made the code tougher to understand.
Now each user's membership to an org includes a single role that they have within the org.
@hojberg
I believe you were previously using the org roles API, now all changes should go through the org members API, so see the new interfaces for the /members endpoints, I'll tag them in comments :)
Implementation notes
roles
endpoints on orgsTest coverage
New and existing transcripts