From 8811bb08e6d5eb024bacdfbb20d039c6b696e1a6 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Nov 2021 12:10:28 +0100 Subject: In ListBuckets, hide entry if no perms --- src/api/s3_bucket.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/api/s3_bucket.rs b/src/api/s3_bucket.rs index c8bbc51b..2be0a818 100644 --- a/src/api/s3_bucket.rs +++ b/src/api/s3_bucket.rs @@ -45,6 +45,7 @@ pub fn handle_list_buckets(api_key: &Key) -> Result, Error> { .authorized_buckets .items() .iter() + .filter(|(_, _, perms)| perms.allow_read || perms.allow_write) .map(|(name, ts, _)| s3_xml::Bucket { creation_date: s3_xml::Value(msec_to_rfc3339(*ts)), name: s3_xml::Value(name.to_string()), -- cgit v1.2.3