feat: add PATCH /api/groups/members for atomic membership level management#298
Open
TX-RX wants to merge 1 commit intobrian7704:masterfrom
Open
feat: add PATCH /api/groups/members for atomic membership level management#298TX-RX wants to merge 1 commit intobrian7704:masterfrom
TX-RX wants to merge 1 commit intobrian7704:masterfrom
Conversation
…ement Adds a PATCH endpoint to atomically set a user's group membership level rather than requiring separate PUT calls per direction. Also makes the direction parameter optional on DELETE, allowing removal of all direction rows for a user+group pair in a single call. Membership levels: - full (IN+OUT): user can transmit and receive in the group/voice channel - listen (OUT only): user receives traffic but cannot transmit - transmit (IN only): user can transmit but does not receive - none: user has no membership in the group The PATCH endpoint reads existing rows, adds any missing directions, and removes directions no longer in the target set — all in one transaction. RabbitMQ queue unbinds are issued for any OUT rows that are removed, keeping subscription state consistent with the database. These levels map directly to how the Mumble PermissionEnforcementCallback enforces voice permissions: full members (IN+OUT) can speak, listen-only members (OUT only) are muted via the suppress flag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
Does the |
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.
Summary
PATCH /api/groups/membersendpoint to atomically set a user's group membership level via a singlelevelparameter (full,listen,transmit, ornone)directionoptional onDELETE /api/groups/members— omitting it now removes all direction rows for a user+group pair in one callBackground
TAK group memberships use a composite primary key of
(user_id, group_id, direction), which means a full group member legitimately has two rows — oneIN(can transmit) and oneOUT(can receive). This is intentional: the TAK protocol and the existing RabbitMQ binding logic inclient_controller.pydepend on this model.Previously, setting a user's effective access level required knowing the current state and making separate PUT/DELETE calls per direction. There was no atomic way to express "make this user listen-only" or "remove them from the group entirely."
New Endpoint:
PATCH /api/groups/membersRequest body:
{ "username": "alice", "group_name": "TeamA", "level": "listen" }Membership levels:
fulllistentransmitnoneThe endpoint reads existing rows, adds any missing directions, and removes extra directions — all in one transaction. RabbitMQ unbinds are issued only when OUT rows are removed.
Updated Endpoint:
DELETE /api/groups/membersdirectionis now optional. When omitted, all direction rows for the user+group pair are deleted and both IN and OUT routing keys are unbound from RabbitMQ.Relation to Mumble Voice Enforcement
These levels map directly to how
PermissionEnforcementCallbackinmumble_ice_app.pyenforces voice channel permissions:suppressflagINwhen both rows exist, so the PATCH endpoint's level semantics translate cleanly to Mumble behaviorTest Plan
PATCH level=listenremoves IN row, leaves OUT — user becomes listen-onlyPATCH level=fulladds IN row back — user becomes full memberPATCH level=noneremoves all rows — user fully removed from groupDELETEwithout direction removes both IN and OUT rowsDELETEwith direction still removes only the specified row🤖 Generated with Claude Code