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 @@ -343,10 +343,14 @@ 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 ;
346347 const iam_policies = account . iam_user_policies || [ ] ;
347- if ( iam_policies . length === 0 && req . object_sdk . nsfs_config_root ) return ; // We do not have IAM policies in NC yet
348+ if ( iam_policies . length === 0 ) {
349+ 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' ) ;
351+ _throw_iam_access_denied_error_for_s3_operation ( requesting_account , method , resource_arn ) ;
352+ }
348353
349- const requesting_account = req . object_sdk . requesting_account ;
350354 // parallel policy check
351355 const promises = [ ] ;
352356 for ( const iam_policy of iam_policies ) {
@@ -366,7 +370,7 @@ async function authorize_request_iam_policy(req) {
366370 }
367371 }
368372 if ( has_allow_permission ) return ;
369- dbg . log1 ( 'authorize_request_iam_policy: user have inline policies but none of them matched the method' ) ;
373+ dbg . log1 ( 'authorize_request_iam_policy: user has inline policies but none of them matched the method' ) ;
370374 _throw_iam_access_denied_error_for_s3_operation ( requesting_account , method , resource_arn ) ;
371375}
372376
You can’t perform that action at this time.
0 commit comments