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