Unassign existing groups (optionally leave them) #5
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.
Before this - if you call
POST /users
orPATCH /users/:id
groups used to be removed (those which were not passed).After this change, you can pass
unassignExistingGroups: false
as parameter to leave old groups in place.Example:
Before: If you call
groups: [{id: 1, role: 'USER'}]
- if user existed in group with ID 2, user is removed from that group, leaving user only in group 1.After: If you call
groups: [{id: 1, role: 'USER'}], unassignExistingGroups: false
- if user existed in any other group - he/she will be left in that group without removing (unassigning)However, keep in mind, that before this change user was removed only from visible groups (for that specific user). This change only works as toggle only. This means - if user was in group 1, group 2, group 3 (updating/creating without
unassignExistingGroups
parameter) if "admin" that can make changes to that user only sees group 1 and group 2, user was not removed from group 3 (it's not visible for them).✅ Tests (4) for invite and update were written to test this parameter