Skip to content

Commit aaef10b

Browse files
Merge pull request #104 from StuartFerguson/task/#98_estatemerchantlist
Fix GetMerchants bug not using configurable role name
2 parents 2d96f94 + 7c47eb2 commit aaef10b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

EstateManagement/Controllers/MerchantController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ public async Task<IActionResult> GetMerchants([FromRoute] Guid estateId, Cancell
152152
// Get the Estate Id claim from the user
153153
Claim estateIdClaim = ClaimsHelper.GetUserClaim(this.User, "EstateId", estateId.ToString());
154154

155-
if (ClaimsHelper.IsUserRolesValid(this.User, new[] { "Estate" }) == false)
155+
String estateRoleName = Environment.GetEnvironmentVariable("EstateRoleName");
156+
if (ClaimsHelper.IsUserRolesValid(this.User, new[] { String.IsNullOrEmpty(estateRoleName) ? "Estate" : estateRoleName }) == false)
156157
{
157158
return this.Forbid();
158159
}

0 commit comments

Comments
 (0)