Skip to content

Conversation

ChrisPenner
Copy link
Member

@ChrisPenner ChrisPenner commented Sep 22, 2025

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

  • Rework the auth tables to understand that there's a role in the org members table
  • Migrate existing role settings to the new format
  • Remove now-redundant roles endpoints on orgs
  • Updates transcripts

Test coverage

New and existing transcripts

Comment on lines 51 to 57
fetch "$transcripts_user" POST org-add-members '/orgs/acme/members' '{
"members": [
"test"
{ "subject": "test",
"roles": "org_maintainer"
}
]
}'
Copy link
Member Author

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.

Comment on lines 3 to 23
"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>"
}
}
]
},
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant