diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-11-22 12:10:28 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-11-22 12:10:28 +0100 |
commit | 8811bb08e6d5eb024bacdfbb20d039c6b696e1a6 (patch) | |
tree | 8cc7fd28cd8d373e521ecd308cb0ec337c83959c /src/api | |
parent | 85b2e4ca2935000310dd64dbcfff39f28f69a295 (diff) | |
download | garage-feature/hide-buckets-without-perm.tar.gz garage-feature/hide-buckets-without-perm.zip |
In ListBuckets, hide entry if no permsfeature/hide-buckets-without-perm
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/s3_bucket.rs | 1 |
1 files changed, 1 insertions, 0 deletions
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<Response<Body>, 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()), |