Skip to content

Commit

Permalink
fail fast also in bucketspace_fs
Browse files Browse the repository at this point in the history
Signed-off-by: shirady <[email protected]>
  • Loading branch information
shirady committed Jan 16, 2025
1 parent d9af68c commit cedf1f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sdk/bucketspace_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,10 @@ class BucketSpaceFS extends BucketSpaceSimpleFS {
`arn:aws:s3:::${bucket.name.unwrap()}${bucket_path}`,
undefined
);
if (permission_by_id === "DENY") return false;
// we (currently) allow account identified to be both id and name,
// so if by-id failed, try also name
if (account.owner === undefined && permission_by_id !== 'DENY') {
if (account.owner === undefined) {
permission_by_name = await bucket_policy_utils.has_bucket_policy_permission(
bucket_policy,
account.name.unwrap(),
Expand All @@ -824,8 +825,7 @@ class BucketSpaceFS extends BucketSpaceSimpleFS {
undefined
);
}

if (permission_by_id === 'DENY' || permission_by_name === 'DENY') return false;
if (permission_by_name === 'DENY') return false;
return is_owner || (permission_by_id === 'ALLOW' || permission_by_name === 'ALLOW');
}

Expand Down

0 comments on commit cedf1f2

Please sign in to comment.