fix: drop the owner's FULL_CONTROL grant when grant headers set the bucket ACL

CreateBucket and PutBucketAcl with x-amz-grant-* headers stored the
requested grants plus a FULL_CONTROL grant for the bucket owner, so
GetBucketAcl returned a grant AWS doesn't. On AWS the headers replace the
whole ACL and the owner gets FULL_CONTROL only when a header names it.

UpdateACL now keeps just the header grants when there are any. A canned
ACL and a bucket created without grants still get the owner's FULL_CONTROL
grant. The owner keeps full access either way, since aclAllows lets the
bucket owner perform any action regardless of grants.

Fixes #1407
This commit is contained in:
dualfroz committed 2026-10-14 19:40:59 +02:00
1 parent 3fee7f49c9
commit 0e3045b87f
5 files changed
+142 -41

No files matched your search

+2 -2
View File
@@ -209,8 +209,8 @@ fi
# tags: curl,GetBucketAcl,x-amz-grant-read-acp
@test "REST - FULL_CONTROL permission not returned for owner after CreateBucket with GRANT_READ_ACP" {
if [ "$DIRECT" != "true" ]; then
skip "https://github.com/versity/versitygw/issues/1407"
if [ "$RECREATE_BUCKETS" == "false" ]; then
skip "skip bucket create tests for static buckets"
fi
run get_bucket_name "$BUCKET_ONE_NAME"
assert_success