Skip to content

Editing an extension no longer drops User Manager group memberships - #76

Open
vladm wants to merge 1 commit into
FreePBX:release/17.0from
vladm:release/17.0
Open

Editing an extension no longer drops User Manager group memberships#76
vladm wants to merge 1 commit into
FreePBX:release/17.0from
vladm:release/17.0

Conversation

@vladm

@vladm vladm commented Aug 19, 2026

Copy link
Copy Markdown

The extension page's 'User Manager Settings' hook treated a missing userman_group POST field as "remove the user from every group". Since a disabled multiselect (directory without modifyGroup permission) and a selection cleared by javascript both post nothing, saving an extension could silently strip the linked user's group memberships.

  • Add a hidden userman_group_submitted marker, rendered and kept enabled/disabled in lock-step with the Groups field, and only sync group membership when it is posted; an absent field now means "no change" instead of "remove all"
  • Consolidate the four duplicated sync/strip blocks into userman_sync_groups_from_post(), scoped to the directory whose groups were displayed, guarded by that directory's modifyGroup permission (previously the default directory's permission was checked)
  • Disable the Groups field based on modifyGroup instead of modifyUser
  • Fix usermanSetFields() strict indexOf comparison of numeric ids against string select values, which cleared the Groups selection whenever the Link to a Default User dropdown changed

The extension page's 'User Manager Settings' hook treated a missing
userman_group POST field as "remove the user from every group". Since a
disabled multiselect (directory without modifyGroup permission) and a
selection cleared by javascript both post nothing, saving an extension
could silently strip the linked user's group memberships.
- Add a hidden userman_group_submitted marker, rendered and kept
  enabled/disabled in lock-step with the Groups field, and only sync
  group membership when it is posted; an absent field now means
  "no change" instead of "remove all"
- Consolidate the four duplicated sync/strip blocks into
  userman_sync_groups_from_post(), scoped to the directory whose groups
  were displayed, guarded by that directory's modifyGroup permission
  (previously the default directory's permission was checked)
- Disable the Groups field based on modifyGroup instead of modifyUser
- Fix usermanSetFields() strict indexOf comparison of numeric ids
  against string select values, which cleared the Groups selection
  whenever the Link to a Default User dropdown changed
@sangoma-oss-cla

sangoma-oss-cla Bot commented Aug 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

1 participant