You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
545 B

  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. }