fix: correct DeleteObjectVersionAction (#574)

Co-authored-by: loverustfs <155562731+loverustfs@users.noreply.github.com>
This commit is contained in:
gatewayJ
2025-09-23 09:49:41 +08:00
committed by GitHub
parent 9ddf6a011d
commit d39ce6d8e9
+3 -3
View File
@@ -50,9 +50,9 @@ pub async fn authorize_request<T>(req: &mut S3Request<T>, action: Action) -> S3R
let claims = cred.claims.as_ref().unwrap_or(&default_claims);
let conditions = get_condition_values(&req.headers, cred);
if action != Action::S3Action(S3Action::DeleteObjectAction)
if action == Action::S3Action(S3Action::DeleteObjectAction)
&& req_info.version_id.is_some()
&& iam_store
&& !iam_store
.is_allowed(&Args {
account: &cred.access_key,
groups: &cred.groups,
@@ -66,7 +66,7 @@ pub async fn authorize_request<T>(req: &mut S3Request<T>, action: Action) -> S3R
})
.await
{
return Ok(());
return Err(s3_error!(AccessDenied, "Access Denied"));
}
if iam_store