Rename 'both' policy to 'public' (#1877)

This commit is contained in:
Anis Elleuch
2016-11-08 10:55:55 -08:00
committed by Harshavardhana
parent e14dcccd37
commit cc6fa9acbf
4 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ package cmd
// isValidAccessPERM - is provided access perm string supported.
func (b accessPerms) isValidAccessPERM() bool {
switch b {
case accessNone, accessDownload, accessUpload, accessBoth:
case accessNone, accessDownload, accessUpload, accessPublic:
return true
}
return false
@@ -33,5 +33,5 @@ const (
accessNone = accessPerms("none")
accessDownload = accessPerms("download")
accessUpload = accessPerms("upload")
accessBoth = accessPerms("both")
accessPublic = accessPerms("public")
)
+2 -2
View File
@@ -50,9 +50,9 @@ func (s *TestSuite) TestValidPERMS(c *C) {
perms := accessPerms("none")
c.Assert(perms.isValidAccessPERM(), Equals, true)
c.Assert(string(perms), Equals, "none")
perms = accessPerms("both")
perms = accessPerms("public")
c.Assert(perms.isValidAccessPERM(), Equals, true)
c.Assert(string(perms), Equals, "both")
c.Assert(string(perms), Equals, "public")
perms = accessPerms("download")
c.Assert(perms.isValidAccessPERM(), Equals, true)
c.Assert(string(perms), Equals, "download")
+8 -8
View File
@@ -48,7 +48,7 @@ USAGE:
mc {{.Name}} [FLAGS] TARGET
PERMISSION:
Allowed policies are: [none, download, upload, both].
Allowed policies are: [none, download, upload, public].
FLAGS:
{{range .Flags}}{{.}}
@@ -57,14 +57,14 @@ EXAMPLES:
1. Set bucket to "download" on Amazon S3 cloud storage.
$ mc {{.Name}} download s3/burningman2011
2. Set bucket to "both" on Amazon S3 cloud storage.
$ mc {{.Name}} both s3/shared
2. Set bucket to "public" on Amazon S3 cloud storage.
$ mc {{.Name}} public s3/shared
3. Set bucket to "upload" on Amazon S3 cloud storage.
$ mc {{.Name}} upload s3/incoming
4. Set a prefix to "both" on Amazon S3 cloud storage.
$ mc {{.Name}} both s3/public-commons/images
4. Set a prefix to "public" on Amazon S3 cloud storage.
$ mc {{.Name}} public s3/public-commons/images
5. Get bucket permissions.
$ mc {{.Name}} s3/shared
@@ -132,7 +132,7 @@ func checkPolicySyntax(ctx *cli.Context) {
perms := accessPerms(ctx.Args().Get(0))
if !perms.isValidAccessPERM() {
fatalIf(errDummy().Trace(),
"Unrecognized permission ‘"+string(perms)+"’. Allowed values are [none, download, upload, both].")
"Unrecognized permission ‘"+string(perms)+"’. Allowed values are [none, download, upload, public].")
}
}
if len(ctx.Args()) < 1 {
@@ -154,7 +154,7 @@ func doSetAccess(targetURL string, targetPERMS accessPerms) *probe.Error {
policy = "readonly"
case accessUpload:
policy = "writeonly"
case accessBoth:
case accessPublic:
policy = "readwrite"
}
if err = clnt.SetAccess(policy); err != nil {
@@ -182,7 +182,7 @@ func doGetAccess(targetURL string) (perms accessPerms, err *probe.Error) {
case "writeonly":
policy = accessUpload
case "readwrite":
policy = accessBoth
policy = accessPublic
}
return policy, nil
+1 -1
View File
@@ -712,7 +712,7 @@ USAGE:
mc policy [FLAGS] TARGET
PERMISSION:
Allowed policies are: [none, download, upload, both].
Allowed policies are: [none, download, upload, public].
FLAGS:
--help, -h Help of policy.