assign_roles's doc says "Everyone in a group holds member", but joining doesn't enforce it: - default_roles returns only the roles marked default. After putRole member {default: false} and putRole rider {default: true}, anyone who then joins (open policy, invite, or admitMember without roles) holds only rider. - admitMember {roles: [{role: "moderator"}]} gives exactly [moderator]. Either way the newcomer can't read the members space, whose access is readableBy: [member], so they can't see their group's roster. The MemberRole guard (group_members.rs:397) only fires when member is already held. So assignRoles {roles: []} on such a member is accepted and writes a membership with no roles. The group's methods then treat them as a member (Members::membership is Some([])), while the space authority treats them as nobody (can_write_own/can_read need roles, rbac.rs:73,85,88). That is a split state. No test covers either path. an_open_group_admits_at_once marks both member and rider as defaults.
How to see it
Read against docs/fresh at 4636e6d, the code at: group_members.rs:96-108; group_join.rs:169-172; group_members.rs:397. Paths are under crates/group-host/src unless they say otherwise. Severity: medium.
What you expected
Have put_membership (or both join paths and assignRoles) always add member, and refuse an empty set in assignRoles.
Where
The host, as built from 4636e6d. Found while checking the docs against the code.
What happened
assign_roles's doc says "Everyone in a group holdsmember", but joining doesn't enforce it: -default_rolesreturns only the roles markeddefault. AfterputRole member {default: false}andputRole rider {default: true}, anyone who then joins (open policy, invite, oradmitMemberwithoutroles) holds onlyrider. -admitMember {roles: [{role: "moderator"}]}gives exactly[moderator]. Either way the newcomer can't read the members space, whose access isreadableBy: [member], so they can't see their group's roster. TheMemberRoleguard (group_members.rs:397) only fires whenmemberis already held. SoassignRoles {roles: []}on such a member is accepted and writes a membership with no roles. The group's methods then treat them as a member (Members::membershipisSome([])), while the space authority treats them as nobody (can_write_own/can_readneed roles, rbac.rs:73,85,88). That is a split state. No test covers either path.an_open_group_admits_at_oncemarks bothmemberandrideras defaults.How to see it
Read against
docs/freshat 4636e6d, the code at: group_members.rs:96-108; group_join.rs:169-172; group_members.rs:397. Paths are undercrates/group-host/srcunless they say otherwise. Severity: medium.What you expected
Have
put_membership(or both join paths andassignRoles) always addmember, and refuse an empty set inassignRoles.Where
The host, as built from 4636e6d. Found while checking the docs against the code.