@@ -344,12 +344,11 @@ async function authorize_request_iam_policy(req) {
344344
345345 const resource_arn = _get_arn_from_req_path ( req ) || '*' ; // special case for list all buckets in an account
346346 const method = _get_method_from_req ( req ) ;
347- const requesting_account = req . object_sdk . requesting_account ;
348347 const iam_policies = account . iam_user_policies || [ ] ;
349348 if ( iam_policies . length === 0 ) {
350349 if ( req . object_sdk . nsfs_config_root ) return ; // We do not have IAM policies in NC yet
351350 dbg . log1 ( 'authorize_request_iam_policy: IAM user has no inline policies configured' ) ;
352- _throw_iam_access_denied_error_for_s3_operation ( requesting_account , method , resource_arn ) ;
351+ _throw_iam_access_denied_error_for_s3_operation ( account , method , resource_arn ) ;
353352 }
354353
355354 // parallel policy check
@@ -365,14 +364,14 @@ async function authorize_request_iam_policy(req) {
365364 const permission_result = await Promise . all ( promises ) ;
366365 let has_allow_permission = false ;
367366 for ( const permission of permission_result ) {
368- if ( permission === "DENY" ) _throw_iam_access_denied_error_for_s3_operation ( requesting_account , method , resource_arn ) ;
367+ if ( permission === "DENY" ) _throw_iam_access_denied_error_for_s3_operation ( account , method , resource_arn ) ;
369368 if ( permission === "ALLOW" ) {
370369 has_allow_permission = true ;
371370 }
372371 }
373372 if ( has_allow_permission ) return ;
374373 dbg . log1 ( 'authorize_request_iam_policy: user has inline policies but none of them matched the method' ) ;
375- _throw_iam_access_denied_error_for_s3_operation ( requesting_account , method , resource_arn ) ;
374+ _throw_iam_access_denied_error_for_s3_operation ( account , method , resource_arn ) ;
376375}
377376
378377function _throw_iam_access_denied_error_for_s3_operation ( requesting_account , method , resource_arn ) {
0 commit comments