Skip to content

Offer synced user groups in the device group Add User Group links - #8427

Open
SanderYaz wants to merge 1 commit into
Ylianst:masterfrom
SanderYaz:fix/synced-user-groups-add-link
Open

SanderYaz wants to merge 1 commit into
Ylianst:masterfrom
SanderYaz:fix/synced-user-groups-add-link

Conversation

@SanderYaz

Copy link
Copy Markdown

Fixes #8330

What

The "Add User Group" links in the device group Users view and the device Users view skipped any user group that has a membershipType (OIDC/LDAP synced groups). This removes that condition in the three places it was used, in both views/default.handlebars and views/default3.handlebars.

Why

The usergroups command only includes membershipType for callers with the user group site right (meshuser.js, full objects), while other callers get a limited { name } projection. So the client-side filter hid synced groups from site admins but not from mesh admins. The server's addmeshuser does not restrict synced groups, so mesh admins could link them and site admins could not. Linking a directory-synced group to a device group is the usual way to grant directory-managed groups access, so I dropped the filter instead of adding it to the limited projection.

The user-side lists (adding a user to a user group, around currentUser) are left unchanged. Synced group membership is managed by the directory there, and the server already refuses those changes.

Verification

  • Ran a small Node script that copies the old and new loop conditions and feeds them a synced group in both server shapes. Old: site admin 0 groups, mesh admin 1. New: 1 for both.
  • Reviewed the diff: only the three membershipType conditions per file are removed (6 lines in total).

Not covered

I did not run MeshCentral with OIDC group sync, so I did not click through the UI. The change is untested in a browser.

🤖 Generated with Claude Code

… User Group links

The "Add User Group" links in the device group and device Users views
skipped user groups that have a membershipType (OIDC/LDAP synced groups).
The server only sends membershipType to callers with the user group site
right, so site admins never got the link for synced groups while mesh
admins did. Linking a synced group to a device group is allowed by the
server, so stop filtering on membershipType in these three places (in both
the default and default3 views).

Fixes Ylianst#8330

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

UI privilege inversion: synced user groups hidden from full admins but linkable by mesh admins (membershipType only in admin projection)

1 participant