Duplicate Roles

Topics: Controls
Aug 19, 2013 at 4:39 PM
Edited Aug 19, 2013 at 4:41 PM
Hi All,
Anybody got any ideas as to what can cause duplicate roles in BE 2 with XML provider.

If I flush the cache, duplicates temporarily disappear, but they come back again pretty quick.

Have a vague recollection of reading about something like this before, but can't find anything on it just now.
Aug 20, 2013 at 12:32 PM
I guess this is maybe due to some combination of server side settings configured just right to be wrong and mangling the cache.

Anyway, that's out of my control. I just need it not to happen, this seems to do the trick.

Change to XmlRoleProvider.cs in core.

From
 public override string[] GetAllRoles()
        {
            return this.roles.Select(role => role.Name).ToArray();
        }
To
 public override string[] GetAllRoles()
        {
            return this.roles.Select(role => role.Name).Distinct().ToArray();
        }