@@ -93,7 +93,8 @@ public async Task<IActionResult> CreateMerchant([FromRoute] Guid estateId,
9393 // Get the Estate Id claim from the user
9494 Claim estateIdClaim = ClaimsHelper . GetUserClaim ( this . User , "EstateId" , estateId . ToString ( ) ) ;
9595
96- if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { "Estate" } ) == false )
96+ String estateRoleName = Environment . GetEnvironmentVariable ( "EstateRoleName" ) ;
97+ if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { String . IsNullOrEmpty ( estateRoleName ) ? "Estate" : estateRoleName } ) == false )
9798 {
9899 return this . Forbid ( ) ;
99100 }
@@ -150,7 +151,8 @@ public async Task<IActionResult> GetMerchant([FromRoute] Guid estateId, [FromRou
150151 // Get the Estate Id claim from the user
151152 Claim estateIdClaim = ClaimsHelper . GetUserClaim ( this . User , "EstateId" , estateId . ToString ( ) ) ;
152153
153- if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { "Estate" } ) == false )
154+ String estateRoleName = Environment . GetEnvironmentVariable ( "EstateRoleName" ) ;
155+ if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { String . IsNullOrEmpty ( estateRoleName ) ? "Estate" : estateRoleName } ) == false )
154156 {
155157 return this . Forbid ( ) ;
156158 }
@@ -188,7 +190,8 @@ public async Task<IActionResult> AssignOperator([FromRoute] Guid estateId,
188190 // Get the Estate Id claim from the user
189191 Claim estateIdClaim = ClaimsHelper . GetUserClaim ( this . User , "EstateId" , estateId . ToString ( ) ) ;
190192
191- if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { "Estate" } ) == false )
193+ String estateRoleName = Environment . GetEnvironmentVariable ( "EstateRoleName" ) ;
194+ if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { String . IsNullOrEmpty ( estateRoleName ) ? "Estate" : estateRoleName } ) == false )
192195 {
193196 return this . Forbid ( ) ;
194197 }
@@ -224,7 +227,8 @@ public async Task<IActionResult> CreateMerchantUser([FromRoute] Guid estateId,
224227 // Get the Estate Id claim from the user
225228 Claim estateIdClaim = ClaimsHelper . GetUserClaim ( this . User , "EstateId" , estateId . ToString ( ) ) ;
226229
227- if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { "Estate" } ) == false )
230+ String estateRoleName = Environment . GetEnvironmentVariable ( "EstateRoleName" ) ;
231+ if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { String . IsNullOrEmpty ( estateRoleName ) ? "Estate" : estateRoleName } ) == false )
228232 {
229233 return this . Forbid ( ) ;
230234 }
@@ -264,7 +268,8 @@ public async Task<IActionResult> AddDevice([FromRoute] Guid estateId,
264268 // Get the Estate Id claim from the user
265269 Claim estateIdClaim = ClaimsHelper . GetUserClaim ( this . User , "EstateId" , estateId . ToString ( ) ) ;
266270
267- if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { "Estate" } ) == false )
271+ String estateRoleName = Environment . GetEnvironmentVariable ( "EstateRoleName" ) ;
272+ if ( ClaimsHelper . IsUserRolesValid ( this . User , new [ ] { String . IsNullOrEmpty ( estateRoleName ) ? "Estate" : estateRoleName } ) == false )
268273 {
269274 return this . Forbid ( ) ;
270275 }
0 commit comments