Support adding users to user groups at invitation time (AddOrganizationMemberUser / AddProjectMemberUser usergroups) - #9858
Open
nishantmonu51 wants to merge 1 commit into
Open
Support adding users to user groups at invitation time (AddOrganizationMemberUser / AddProjectMemberUser usergroups)#9858nishantmonu51 wants to merge 1 commit into
AddOrganizationMemberUser / AddProjectMemberUser usergroups)#9858nishantmonu51 wants to merge 1 commit into
Conversation
Admins can now pick user groups when inviting a user, instead of waiting for the invite to be accepted and adding the user to groups afterwards. Backend: - `AddOrganizationMemberUser` and `AddProjectMemberUser` accept `usergroups`. For a pending signup the groups are stored on the org invite (additively merged on re-invite) and applied on acceptance; for an existing user they are applied immediately in the same transaction. - A shared resolver validates groups (exist, not managed, admin-role guard) and is reused by `AddUsergroupMemberUser`. - `OrganizationInvite` exposes `usergroups`; `ListUsergroupMemberUsers` lists pending invitees with `pending_acceptance`; `RemoveUsergroupMemberUser` works on pending invitees; deleting a group scrubs it from pending invites. CLI: - `rill user add --group` is repeatable and rides along with the org or project invite in one call; the interactive fallback keeps attributes. - `rill user list` shows groups and attributes on pending invites and a status column on group member listings. Frontend: - Group multi-select in the Add users and Add guests dialogs. - Pending rows show their groups; a Manage groups action on every user row. - The Create and Edit group dialogs list and can add pending invitees.
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.
Admins can now assign user groups when inviting a user, instead of inviting, waiting for acceptance, and then adding them to groups. Follows the pattern used for invite-time attributes in #9797. The
org_invites.usergroup_idscolumn and its application on signup already existed; this PR exposes it through the APIs, CLI, and UI.Backend
AddOrganizationMemberUserandAddProjectMemberUseracceptusergroups(group names). For a pending signup they are stored on the org invite and merged additively on re-invite; for an existing user they are applied immediately in the same transaction (ON CONFLICT DO NOTHING, so it is safe inside the tx).resolveUsergroupsForMembershipvalidates groups (exist, not managed, admin-role guard) and is reused byAddUsergroupMemberUser, so the rules cannot drift.OrganizationInviteexposesusergroups;ListUsergroupMemberUsersincludes pending invitees withpending_acceptance;RemoveUsergroupMemberUserhandles pending invitees;DeleteUsergroupscrubs the group from pending invites.rbac_test.goandpostgres_test.go.CLI
rill user add --groupis repeatable and is sent with the org or project invite in a single call. The interactive fallback no longer drops--attributevalues.rill user listshows groups and attributes on pending invites, and astatuscolumn for group members.Frontend
UserGroupsMultiSelectin the Add users and Add guests dialogs.ManageUserGroupsDialogis reachable from a "Manage groups" action on every row of the users and guests tables.Checklist: