acp_ownership.go 545 B

123456789101112131415161718
  1. package s3_constants
  2. var (
  3. OwnershipBucketOwnerPreferred = "BucketOwnerPreferred"
  4. OwnershipObjectWriter = "ObjectWriter"
  5. OwnershipBucketOwnerEnforced = "BucketOwnerEnforced"
  6. DefaultOwnershipForCreate = OwnershipObjectWriter
  7. DefaultOwnershipForExists = OwnershipBucketOwnerEnforced
  8. )
  9. func ValidateOwnership(ownership string) bool {
  10. if ownership == "" || (ownership != OwnershipBucketOwnerPreferred && ownership != OwnershipObjectWriter && ownership != OwnershipBucketOwnerEnforced) {
  11. return false
  12. } else {
  13. return true
  14. }
  15. }