VAPP-25: User groups: list, create, edit, delete, manage members #29

Merged
David merged 2 commits from feat/user-groups-vapp-25 into main 2026-06-07 19:45:45 +02:00
Owner

Implements VAPP-25: user-group administration on the Users page.

What changed

Adds a Groups tab to the Users page (one sidebar entry preserved) for site-admin user-group management, reusing the existing Users-table and Meshes-dialog patterns.

  • Server fns (src/server_fns/mod.rs), all over the control channel, mirroring vervain-server's user-group dispatch in crates/meshcentral-web/src/user_session.rs: list_user_groups (usergroups), create_user_group (createusergroup), edit_user_group (editusergroup), delete_user_group (deleteusergroup), add_user_to_group (addusertousergroup, short usernames), remove_user_from_group (removeuserfromusergroup, full user id). Writes are ack-checked via request_ack, so validation and the admin gate render inline.
  • Non-admin gate: usergroups returns an empty map for non-admins instead of an error, so list_user_groups reads siteadmin from the connect-burst userinfo frame and returns an explanatory error when the caller is not a full site admin.
  • UI (src/components/pages/user_groups.rs): header strip with "+ New group", a name/description/members table, per-row edit and delete. Create is a modal; delete is a typed-name confirmation; edit is a drawer that renames/re-describes and edits membership (member list with remove plus an add row fed by list_users), updating optimistically so changes show without a reload. users.rs hosts the Users/Groups tab strip.
  • Model: new UserGroup { id, name, description, members } in src/models/mod.rs.

Acceptance criteria

  • Users page has Users and Groups tabs; Groups lists existing user groups
  • Create, edit (name/description), and delete work with confirmation on delete
  • Members can be added and removed from a group; changes show without a reload
  • Non-admin users get an explanatory inline error
  • just check passes (fmt, clippy on server + wasm, both cargo checks, tests)

🤖 Generated with Claude Code

Implements VAPP-25: user-group administration on the Users page. ## What changed Adds a **Groups** tab to the Users page (one sidebar entry preserved) for site-admin user-group management, reusing the existing Users-table and Meshes-dialog patterns. - **Server fns** (`src/server_fns/mod.rs`), all over the control channel, mirroring vervain-server's user-group dispatch in `crates/meshcentral-web/src/user_session.rs`: `list_user_groups` (`usergroups`), `create_user_group` (`createusergroup`), `edit_user_group` (`editusergroup`), `delete_user_group` (`deleteusergroup`), `add_user_to_group` (`addusertousergroup`, short usernames), `remove_user_from_group` (`removeuserfromusergroup`, full user id). Writes are ack-checked via `request_ack`, so validation and the admin gate render inline. - **Non-admin gate:** `usergroups` returns an empty map for non-admins instead of an error, so `list_user_groups` reads `siteadmin` from the connect-burst `userinfo` frame and returns an explanatory error when the caller is not a full site admin. - **UI** (`src/components/pages/user_groups.rs`): header strip with "+ New group", a name/description/members table, per-row edit and delete. Create is a modal; delete is a typed-name confirmation; edit is a drawer that renames/re-describes and edits membership (member list with remove plus an add row fed by `list_users`), updating optimistically so changes show without a reload. `users.rs` hosts the Users/Groups tab strip. - **Model:** new `UserGroup { id, name, description, members }` in `src/models/mod.rs`. ## Acceptance criteria - [x] Users page has Users and Groups tabs; Groups lists existing user groups - [x] Create, edit (name/description), and delete work with confirmation on delete - [x] Members can be added and removed from a group; changes show without a reload - [x] Non-admin users get an explanatory inline error - [x] `just check` passes (fmt, clippy on server + wasm, both cargo checks, tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(users): user-group management (list, CRUD, members)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 2m1s
c7e4ab0eb2
Add a Groups tab to the Users page for site-admin user-group administration, mirroring the existing Users table and Meshes dialog patterns and keeping one sidebar entry.

New control-channel server fns in src/server_fns/mod.rs proxy vervain-server's user-group dispatch: list_user_groups (usergroups), create_user_group (createusergroup), edit_user_group (editusergroup), delete_user_group (deleteusergroup), add_user_to_group (addusertousergroup, which takes short usernames), and remove_user_from_group (removeuserfromusergroup, which takes the full user id). Frame shapes verified against crates/meshcentral-web/src/user_session.rs. Each write is ack-checked via request_ack so the admin gate and validation errors surface inline.

usergroups returns an empty map for non-admins rather than an error, so list_user_groups reads siteadmin from the connect-burst userinfo frame and returns an explanatory error when the caller is not a full site admin, matching the rest of user admin.

UI: src/components/pages/user_groups.rs holds the Groups view (header strip with "+ New group", a name/description/members table, per-row edit and delete). Create is a modal; delete is a typed-name confirmation; edit is a drawer that renames/re-describes and edits membership (member list with remove plus an add row fed by list_users), updating optimistically so changes show without a reload. users.rs now hosts a Users/Groups tab strip over the existing accounts table.

New UserGroup model in src/models/mod.rs carries id, name, description, and the member user ids from the group doc's links map.

#VAPP-25

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge branch 'main' into feat/user-groups-vapp-25
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + build + tests (pull_request) Successful in 1m0s
63ca7acf8e
David merged commit 301e7d9e3e into main 2026-06-07 19:45:45 +02:00
David deleted branch feat/user-groups-vapp-25 2026-06-07 19:45:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!29
No description provided.