Skip to content

Commit 483d25c

Browse files
authored
Allow policy with "s3:*Object" to download using Console (#2396)
1 parent dab4eb7 commit 483d25c

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

portal-ui/src/common/SecureComponent/permissions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const IAM_SCOPES = {
2626
S3_GET_BUCKET_POLICY: "s3:GetBucketPolicy",
2727
S3_PUT_BUCKET_POLICY: "s3:PutBucketPolicy",
2828
S3_GET_OBJECT: "s3:GetObject",
29+
S3_STAR_OBJECT: "s3:*Object",
2930
S3_PUT_OBJECT: "s3:PutObject",
3031
S3_GET_OBJECT_LEGAL_HOLD: "s3:GetObjectLegalHold",
3132
S3_PUT_OBJECT_LEGAL_HOLD: "s3:PutObjectLegalHold",

portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,9 +1236,18 @@ const ListObjects = () => {
12361236
uploadPath = uploadPath.concat(currentPath);
12371237
}
12381238

1239-
const canDownload = hasPermission(bucketName, [IAM_SCOPES.S3_GET_OBJECT]);
1240-
const canDelete = hasPermission(bucketName, [IAM_SCOPES.S3_DELETE_OBJECT]);
1241-
const canUpload = hasPermission(uploadPath, [IAM_SCOPES.S3_PUT_OBJECT]);
1239+
const canDownload = hasPermission(bucketName, [
1240+
IAM_SCOPES.S3_GET_OBJECT,
1241+
IAM_SCOPES.S3_STAR_OBJECT,
1242+
]);
1243+
const canDelete = hasPermission(bucketName, [
1244+
IAM_SCOPES.S3_DELETE_OBJECT,
1245+
IAM_SCOPES.S3_STAR_OBJECT,
1246+
]);
1247+
const canUpload = hasPermission(uploadPath, [
1248+
IAM_SCOPES.S3_PUT_OBJECT,
1249+
IAM_SCOPES.S3_STAR_OBJECT,
1250+
]);
12421251

12431252
const onClosePanel = (forceRefresh: boolean) => {
12441253
dispatch(setSelectedObjectView(null));

portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ObjectDetailPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import {
4545
IAM_SCOPES,
4646
permissionTooltipHelper,
4747
} from "../../../../../../common/SecureComponent/permissions";
48-
4948
import { AppState, useAppDispatch } from "../../../../../../store";
5049
import {
5150
DeleteIcon,
@@ -431,6 +430,7 @@ const ObjectDetailPanel = ({
431430
]);
432431
const canGetObject = hasPermission(objectResources, [
433432
IAM_SCOPES.S3_GET_OBJECT,
433+
IAM_SCOPES.S3_STAR_OBJECT,
434434
]);
435435
const canDelete = hasPermission(
436436
[bucketName, currentItem, [bucketName, actualInfo.name].join("/")],

portal-ui/src/screens/Console/Buckets/ListBuckets/UploadFilesButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ const UploadFilesButton = ({
6969

7070
const uploadObjectAllowed = hasPermission(uploadPath, [
7171
IAM_SCOPES.S3_PUT_OBJECT,
72+
IAM_SCOPES.S3_STAR_OBJECT,
7273
]);
7374
const uploadFolderAllowed = hasPermission(
7475
bucketName,
75-
[IAM_SCOPES.S3_PUT_OBJECT],
76+
[IAM_SCOPES.S3_PUT_OBJECT, IAM_SCOPES.S3_STAR_OBJECT],
7677
false,
7778
true
7879
);

0 commit comments

Comments
 (0)