diff --git a/weed/s3api/s3_action_resolver.go b/weed/s3api/s3_action_resolver.go index dc1fab4bb..113f3f4a5 100644 --- a/weed/s3api/s3_action_resolver.go +++ b/weed/s3api/s3_action_resolver.go @@ -68,7 +68,7 @@ var bucketQueryActions = map[string]map[string]string{ "lifecycle": { http.MethodGet: s3_constants.S3_ACTION_GET_BUCKET_LIFECYCLE, http.MethodPut: s3_constants.S3_ACTION_PUT_BUCKET_LIFECYCLE, - http.MethodDelete: s3_constants.S3_ACTION_DELETE_BUCKET_LIFECYCLE, + http.MethodDelete: s3_constants.S3_ACTION_PUT_BUCKET_LIFECYCLE, // DELETE uses same permission as PUT }, "versioning": { http.MethodGet: s3_constants.S3_ACTION_GET_BUCKET_VERSIONING, diff --git a/weed/s3api/s3_constants/s3_action_strings.go b/weed/s3api/s3_constants/s3_action_strings.go index d655d60d0..c7d5541c9 100644 --- a/weed/s3api/s3_constants/s3_action_strings.go +++ b/weed/s3api/s3_constants/s3_action_strings.go @@ -60,9 +60,9 @@ const ( S3_ACTION_DELETE_BUCKET_CORS = "s3:DeleteBucketCors" // Bucket lifecycle operations - S3_ACTION_GET_BUCKET_LIFECYCLE = "s3:GetLifecycleConfiguration" - S3_ACTION_PUT_BUCKET_LIFECYCLE = "s3:PutLifecycleConfiguration" - S3_ACTION_DELETE_BUCKET_LIFECYCLE = "s3:PutLifecycleConfiguration" + // Note: Both PUT and DELETE lifecycle operations use s3:PutLifecycleConfiguration + S3_ACTION_GET_BUCKET_LIFECYCLE = "s3:GetLifecycleConfiguration" + S3_ACTION_PUT_BUCKET_LIFECYCLE = "s3:PutLifecycleConfiguration" // Bucket versioning operations S3_ACTION_GET_BUCKET_VERSIONING = "s3:GetBucketVersioning"