File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -344,10 +344,14 @@ 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 ;
347348 const iam_policies = account . iam_user_policies || [ ] ;
348- if ( iam_policies . length === 0 && req . object_sdk . nsfs_config_root ) return ; // We do not have IAM policies in NC yet
349+ if ( iam_policies . length === 0 ) {
350+ if ( req . object_sdk . nsfs_config_root ) return ; // We do not have IAM policies in NC yet
351+ 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 ) ;
353+ }
349354
350- const requesting_account = req . object_sdk . requesting_account ;
351355 // parallel policy check
352356 const promises = [ ] ;
353357 for ( const iam_policy of iam_policies ) {
@@ -367,7 +371,7 @@ async function authorize_request_iam_policy(req) {
367371 }
368372 }
369373 if ( has_allow_permission ) return ;
370- dbg . log1 ( 'authorize_request_iam_policy: user have inline policies but none of them matched the method' ) ;
374+ dbg . log1 ( 'authorize_request_iam_policy: user has inline policies but none of them matched the method' ) ;
371375 _throw_iam_access_denied_error_for_s3_operation ( requesting_account , method , resource_arn ) ;
372376}
373377
You can’t perform that action at this time.
0 commit comments