@@ -347,7 +347,7 @@ async function authorize_request_iam_policy(req) {
347347 const iam_policies = account . iam_user_policies || [ ] ;
348348 if ( iam_policies . length === 0 ) {
349349 if ( req . object_sdk . nsfs_config_root ) return ; // We do not have IAM policies in NC yet
350- dbg . log1 ( 'authorize_request_iam_policy: IAM user has no inline policies configured' ) ;
350+ dbg . error ( 'authorize_request_iam_policy: IAM user has no inline policies configured' ) ;
351351 _throw_iam_access_denied_error_for_s3_operation ( account , method , resource_arn ) ;
352352 }
353353
@@ -364,13 +364,16 @@ async function authorize_request_iam_policy(req) {
364364 const permission_result = await Promise . all ( promises ) ;
365365 let has_allow_permission = false ;
366366 for ( const permission of permission_result ) {
367- if ( permission === "DENY" ) _throw_iam_access_denied_error_for_s3_operation ( account , method , resource_arn ) ;
367+ if ( permission === "DENY" ) {
368+ dbg . error ( 'authorize_request_iam_policy: user has explicit DENY inline policy' ) ;
369+ _throw_iam_access_denied_error_for_s3_operation ( account , method , resource_arn ) ;
370+ }
368371 if ( permission === "ALLOW" ) {
369372 has_allow_permission = true ;
370373 }
371374 }
372375 if ( has_allow_permission ) return ;
373- dbg . log1 ( 'authorize_request_iam_policy: user has inline policies but none of them matched the method' ) ;
376+ dbg . error ( 'authorize_request_iam_policy: user has inline policies but none of them matched the method' ) ;
374377 _throw_iam_access_denied_error_for_s3_operation ( account , method , resource_arn ) ;
375378}
376379
0 commit comments