Skip to content

Commit 3672155

Browse files
committed
auth server changes
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
1 parent 7f01b91 commit 3672155

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/server/common_services/auth_server.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,20 @@ async function has_bucket_action_permission(bucket, account, action, req_query,
566566
);
567567

568568
if (result === 'DENY') return false;
569-
return is_owner || result === 'ALLOW';
569+
570+
let permission_by_arn_owner;
571+
if (account.owner) {
572+
const owner_account_identifier_arn = s3_bucket_policy_utils.create_arn_for_root(account.owner._id.toString());
573+
permission_by_arn_owner = await s3_bucket_policy_utils.has_bucket_policy_permission(
574+
bucket_policy,
575+
owner_account_identifier_arn,
576+
action,
577+
`arn:aws:s3:::${bucket.name.unwrap()}${bucket_path}`,
578+
req_query,
579+
);
580+
if (permission_by_arn_owner === 'DENY') return false;
581+
}
582+
return is_owner || result === 'ALLOW' || permission_by_arn_owner === 'ALLOW';
570583
}
571584

572585
/**

0 commit comments

Comments
 (0)