From 825627e345a36bb1d8c7ac3b23e6126111e8872d Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Tue, 27 May 2014 13:49:13 +1000 Subject: [PATCH] Bug Fix: Update Admins blocked all Admins The updated subject hash was case-sensitive when it should have been reinitialized with the OrdinalIgnoreCase string comparer. --- Disco.Services/Authorization/Roles/RoleCache.cs | 2 +- Disco.Services/Authorization/Roles/RoleToken.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Disco.Services/Authorization/Roles/RoleCache.cs b/Disco.Services/Authorization/Roles/RoleCache.cs index 23fdea52..eb2e241e 100644 --- a/Disco.Services/Authorization/Roles/RoleCache.cs +++ b/Disco.Services/Authorization/Roles/RoleCache.cs @@ -91,7 +91,7 @@ namespace Disco.Services.Authorization.Roles // Update State _AdministratorToken.SubjectIds = SubjectIds.ToList(); - _AdministratorToken.SubjectIdHashes = new HashSet(SubjectIds.Select(i => i.ToLower())); + _AdministratorToken.SubjectIdHashes = new HashSet(SubjectIds, StringComparer.OrdinalIgnoreCase); } /// diff --git a/Disco.Services/Authorization/Roles/RoleToken.cs b/Disco.Services/Authorization/Roles/RoleToken.cs index 2562de9b..5a4ce6fc 100644 --- a/Disco.Services/Authorization/Roles/RoleToken.cs +++ b/Disco.Services/Authorization/Roles/RoleToken.cs @@ -30,7 +30,7 @@ namespace Disco.Services.Authorization.Roles return new RoleToken() { Role = Role, - SubjectIdHashes = new HashSet(sg.Select(i => i.ToLower()), StringComparer.OrdinalIgnoreCase), + SubjectIdHashes = new HashSet(sg, StringComparer.OrdinalIgnoreCase), SubjectIds = sg.ToList(), Claims = Claims };