From d532c7c9725fb3e66f5240b3adcb02df7efbf738 Mon Sep 17 00:00:00 2001 From: GatewayJ <835269233@qq.com> Date: Sat, 10 Jan 2026 10:11:08 +0800 Subject: [PATCH] feat: object-list access (#1457) Signed-off-by: loverustfs Co-authored-by: loverustfs Co-authored-by: loverustfs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- rustfs/src/storage/access.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rustfs/src/storage/access.rs b/rustfs/src/storage/access.rs index 10b74164..8964d94d 100644 --- a/rustfs/src/storage/access.rs +++ b/rustfs/src/storage/access.rs @@ -817,11 +817,14 @@ impl S3Access for FS { authorize_request(req, Action::S3Action(S3Action::ListBucketMultipartUploadsAction)).await } - /// Checks whether the ListObjectVersions request has accesses to the resources. + /// Checks whether the `ListObjectVersions` request is authorized for the requested bucket. /// - /// This method returns `Ok(())` by default. - async fn list_object_versions(&self, _req: &mut S3Request) -> S3Result<()> { - Ok(()) + /// Returns `Ok(())` if the request is allowed, or an error if access is denied or another + /// authorization-related issue occurs. + async fn list_object_versions(&self, req: &mut S3Request) -> S3Result<()> { + let req_info = req.extensions.get_mut::().expect("ReqInfo not found"); + req_info.bucket = Some(req.input.bucket.clone()); + authorize_request(req, Action::S3Action(S3Action::ListBucketVersionsAction)).await } /// Checks whether the ListObjects request has accesses to the resources.