Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider the 'case' of the Member Group/Role Name when comparing... #2552

Merged
merged 1 commit into from Jul 25, 2018

Conversation

marcemarc
Copy link
Contributor

@marcemarc marcemarc commented Mar 29, 2018

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

…ing assignment, whether or not the Member Group/Role exists and whether it needs to be created... and whether the Member belongs to a particular Group/Role and whether they need to be assigned.
@nul800sebastiaan nul800sebastiaan merged commit f63456a into umbraco:dev-v7 Jul 25, 2018
@nul800sebastiaan
Copy link
Member

Lovely, thanks very much @marcemarc ! 👍

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.

None yet

2 participants