Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow console to recognize s3.DeleteObject* #3497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web-app/src/common/SecureComponent/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const IAM_SCOPES = {
S3_PUT_OBJECT: "s3:PutObject",
S3_GET_ACTIONS: "s3:Get*",
S3_PUT_ACTIONS: "s3:Put*",
S3_DELETE_OBJECT_ACTIONS: "s3:DeleteObject*",
S3_GET_OBJECT_LEGAL_HOLD: "s3:GetObjectLegalHold",
S3_PUT_OBJECT_LEGAL_HOLD: "s3:PutObjectLegalHold",
S3_DELETE_OBJECT: "s3:DeleteObject",
Expand Down Expand Up @@ -197,6 +198,7 @@ export const IAM_PERMISSIONS = {
IAM_SCOPES.S3_PUT_OBJECT,
IAM_SCOPES.S3_PUT_ACTIONS,
IAM_SCOPES.S3_DELETE_OBJECT,
IAM_SCOPES.S3_DELETE_OBJECT_ACTIONS,
],
[IAM_ROLES.BUCKET_VIEWER]: [
IAM_SCOPES.S3_LIST_BUCKET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const ListObjects = () => {
]);
const canDelete = hasPermission(
[pathAsResourceInPolicy, ...sessionGrantWildCards],
[IAM_SCOPES.S3_DELETE_OBJECT],
[IAM_SCOPES.S3_DELETE_OBJECT, IAM_SCOPES.S3_DELETE_OBJECT_ACTIONS],
);
const canUpload =
hasPermission(
Expand Down Expand Up @@ -912,7 +912,7 @@ const ListObjects = () => {
tooltip: canDelete
? "Delete Selected Files"
: permissionTooltipHelper(
[IAM_SCOPES.S3_DELETE_OBJECT],
[IAM_SCOPES.S3_DELETE_OBJECT, IAM_SCOPES.S3_DELETE_OBJECT_ACTIONS],
"delete objects in this bucket",
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,10 @@ const ObjectDetailPanel = ({
canDelete
? ""
: permissionTooltipHelper(
[IAM_SCOPES.S3_DELETE_OBJECT],
[
IAM_SCOPES.S3_DELETE_OBJECT,
IAM_SCOPES.S3_DELETE_OBJECT_ACTIONS,
],
"delete this object",
)
}
Expand All @@ -665,7 +668,10 @@ const ObjectDetailPanel = ({
currentItem,
[bucketName, actualInfo.name].join("/"),
]}
scopes={[IAM_SCOPES.S3_DELETE_OBJECT]}
scopes={[
IAM_SCOPES.S3_DELETE_OBJECT,
IAM_SCOPES.S3_DELETE_OBJECT_ACTIONS,
]}
errorProps={{ disabled: true }}
>
<Button
Expand Down
Loading