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.
This commit is contained in:
@@ -91,7 +91,7 @@ namespace Disco.Services.Authorization.Roles
|
||||
|
||||
// Update State
|
||||
_AdministratorToken.SubjectIds = SubjectIds.ToList();
|
||||
_AdministratorToken.SubjectIdHashes = new HashSet<string>(SubjectIds.Select(i => i.ToLower()));
|
||||
_AdministratorToken.SubjectIdHashes = new HashSet<string>(SubjectIds, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Disco.Services.Authorization.Roles
|
||||
return new RoleToken()
|
||||
{
|
||||
Role = Role,
|
||||
SubjectIdHashes = new HashSet<string>(sg.Select(i => i.ToLower()), StringComparer.OrdinalIgnoreCase),
|
||||
SubjectIdHashes = new HashSet<string>(sg, StringComparer.OrdinalIgnoreCase),
|
||||
SubjectIds = sg.ToList(),
|
||||
Claims = Claims
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user