Consider the 'case' of the Member Group/Role Name when comparing... #2552
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.
...during assignment, If you use _memberService.AssignRole then you can inadvertently create a duplicate Member Group/Role, same text, different case.
Prerequisites
Description
The issue can occur if you assign a member to a group and don't match the 'case' of the existing Member Group Name.
eg
SPECIAL - Admin
and you use
_memberService.AssignRole(123,"Special - Admin")
creates a duplicate 'Special - Admin' member group, instead of assigning the member to the existing one.
The MemberGroupRepositiory has an AssignRolesInternal method that uses Except() and Contains() when comparing whether the role passed in to add for the member 'exists' already, and whether they are are already 'assigned to it'. This PR adds StringComparer.CurrentCultureIgnoreCase into those comparisons, so that new duplicate Member Group/Roles aren't created with differing case...