mirror of
https://github.com/minio/minio.git
synced 2025-02-09 20:58:08 -05:00
Signature calculation has now moved out from being a package to top-level as a layered mechanism. In case of payload calculation with body, go-routines are initiated to simultaneously write and calculate shasum. Errors are sent over the writer so that the lower layer removes the temporary files properly.
50 lines
1.0 KiB
Go
50 lines
1.0 KiB
Go
// +build ignore
|
|
|
|
package xl
|
|
|
|
// BucketACL - bucket level access control
|
|
type BucketACL string
|
|
|
|
// different types of ACL's currently supported for buckets
|
|
const (
|
|
BucketPrivate = BucketACL("private")
|
|
BucketPublicRead = BucketACL("public-read")
|
|
BucketPublicReadWrite = BucketACL("public-read-write")
|
|
)
|
|
|
|
func (b BucketACL) String() string {
|
|
return string(b)
|
|
}
|
|
|
|
// IsPrivate - is acl Private
|
|
func (b BucketACL) IsPrivate() bool {
|
|
return b == BucketACL("private")
|
|
}
|
|
|
|
// IsPublicRead - is acl PublicRead
|
|
func (b BucketACL) IsPublicRead() bool {
|
|
return b == BucketACL("public-read")
|
|
}
|
|
|
|
// IsPublicReadWrite - is acl PublicReadWrite
|
|
func (b BucketACL) IsPublicReadWrite() bool {
|
|
return b == BucketACL("public-read-write")
|
|
}
|
|
|
|
// IsValidBucketACL - is provided acl string supported
|
|
func IsValidBucketACL(acl string) bool {
|
|
switch acl {
|
|
case "private":
|
|
fallthrough
|
|
case "public-read":
|
|
fallthrough
|
|
case "public-read-write":
|
|
return true
|
|
case "":
|
|
// by default its "private"
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|