Skip to content

Commit 82a8264

Browse files
committed
move const to top
1 parent d4a82f0 commit 82a8264

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

lib/api/apiUtils/authorization/permissionChecks.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ const {
1414
const publicReadBuckets = process.env.ALLOW_PUBLIC_READ_BUCKETS
1515
? process.env.ALLOW_PUBLIC_READ_BUCKETS.split(',') : [];
1616

17+
const checkPrincipalResult = Object.freeze({
18+
KO: 0,
19+
CROSS_ACCOUNT_OK: 1,
20+
OK: 2,
21+
});
22+
23+
const checkBucketPolicyResult = Object.freeze({
24+
DEFAULT_DENY: 0,
25+
EXPLICIT_DENY: 1,
26+
ALLOW: 2,
27+
CROSS_ACCOUNT_ALLOW: 3,
28+
});
29+
1730
/**
1831
* Checks the access control for a given bucket based on the request type and user's canonical ID.
1932
*
@@ -283,12 +296,6 @@ function _isRootUser(arn) {
283296
return false;
284297
}
285298

286-
const checkPrincipalResult = Object.freeze({
287-
KO: 0,
288-
CROSS_ACCOUNT_OK: 1,
289-
OK: 2,
290-
});
291-
292299
/** _evaluateCrossAccount - checks if it is a cross-account request.
293300
* @param {string} requesterARN - requester ARN
294301
* @param {string} requesterCanonicalID - requester canonical ID
@@ -391,13 +398,6 @@ function _checkPrincipals(canonicalID, arn, principal, bucketOwnerCanonicalID) {
391398
return checkPrincipalResult.KO;
392399
}
393400

394-
const checkBucketPolicyResult = Object.freeze({
395-
DEFAULT_DENY: 0,
396-
EXPLICIT_DENY: 1,
397-
ALLOW: 2,
398-
CROSS_ACCOUNT_ALLOW: 3,
399-
});
400-
401401
// checkBucketPolicy FSM.
402402
// ┌───────────────────────────┐
403403
// │ ▼

0 commit comments

Comments
 (0)