Editing an extension no longer drops User Manager group memberships - #76
Open
vladm wants to merge 1 commit into
Open
Editing an extension no longer drops User Manager group memberships#76vladm wants to merge 1 commit into
vladm wants to merge 1 commit into
Conversation
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
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.
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.