Skip to content

Commit cedf1f2

Browse files
committed
fail fast also in bucketspace_fs
Signed-off-by: shirady <[email protected]>
1 parent d9af68c commit cedf1f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sdk/bucketspace_fs.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,10 @@ class BucketSpaceFS extends BucketSpaceSimpleFS {
813813
`arn:aws:s3:::${bucket.name.unwrap()}${bucket_path}`,
814814
undefined
815815
);
816+
if (permission_by_id === "DENY") return false;
816817
// we (currently) allow account identified to be both id and name,
817818
// so if by-id failed, try also name
818-
if (account.owner === undefined && permission_by_id !== 'DENY') {
819+
if (account.owner === undefined) {
819820
permission_by_name = await bucket_policy_utils.has_bucket_policy_permission(
820821
bucket_policy,
821822
account.name.unwrap(),
@@ -824,8 +825,7 @@ class BucketSpaceFS extends BucketSpaceSimpleFS {
824825
undefined
825826
);
826827
}
827-
828-
if (permission_by_id === 'DENY' || permission_by_name === 'DENY') return false;
828+
if (permission_by_name === 'DENY') return false;
829829
return is_owner || (permission_by_id === 'ALLOW' || permission_by_name === 'ALLOW');
830830
}
831831

0 commit comments

Comments
 (0)