Browse Source

don't set acp when ownership is BucketOwnerEnfored

Signed-off-by: changlin.shi <changlin.shi@ly.com>
pull/4090/head
changlin.shi 2 years ago
parent
commit
4364f4dfe3
  1. 11
      weed/s3api/s3api_acp.go

11
weed/s3api/s3api_acp.go

@ -61,19 +61,14 @@ func (s3a *S3ApiServer) checkAccessForWriteObject(r *http.Request, bucket, objec
}, },
} }
if len(grants) == 0 { if len(grants) == 0 {
// set default grants
s3acl.SetAcpOwnerHeader(r, accountId)
s3acl.SetAcpGrantsHeader(r, []*s3.Grant{bucketOwnerFullControlGrant})
return s3err.ErrNone return s3err.ErrNone
} }
if !s3acl.GrantEquals(bucketOwnerFullControlGrant, grants[0]) {
return s3err.AccessControlListNotSupported
if s3acl.GrantEquals(bucketOwnerFullControlGrant, grants[0]) {
return s3err.ErrNone
} }
s3acl.SetAcpOwnerHeader(r, accountId)
s3acl.SetAcpGrantsHeader(r, []*s3.Grant{bucketOwnerFullControlGrant})
return s3err.ErrNone
return s3err.AccessControlListNotSupported
} }
//bucket access allowed //bucket access allowed

Loading…
Cancel
Save