diff options
author | Sandro Santilli <strk@kbt.io> | 2016-11-07 17:20:37 +0100 |
---|---|---|
committer | Sandro Santilli <strk@kbt.io> | 2016-11-07 17:20:37 +0100 |
commit | f388661bda8097b5ff01548e6153c566690c9b5e (patch) | |
tree | d0bdf0785474f50eb42b6b4852922201620221cf /cmd | |
parent | 0b62aeb495c9c1daf816a754a0e4abbf8c62c2c0 (diff) | |
download | gitea-f388661bda8097b5ff01548e6153c566690c9b5e.tar.gz gitea-f388661bda8097b5ff01548e6153c566690c9b5e.zip |
ACCESS_MODE_* -> AccessMode*
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/serve.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd/serve.go b/cmd/serve.go index eaaeeb7bc4..4e99ebe5ff 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -64,9 +64,9 @@ func parseCmd(cmd string) (string, string) { var ( allowedCommands = map[string]models.AccessMode{ - "git-upload-pack": models.ACCESS_MODE_READ, - "git-upload-archive": models.ACCESS_MODE_READ, - "git-receive-pack": models.ACCESS_MODE_WRITE, + "git-upload-pack": models.AccessModeRead, + "git-upload-archive": models.AccessModeRead, + "git-receive-pack": models.AccessModeWrite, } ) @@ -191,7 +191,7 @@ func runServ(c *cli.Context) error { } // Prohibit push to mirror repositories. - if requestedMode > models.ACCESS_MODE_READ && repo.IsMirror { + if requestedMode > models.AccessModeRead && repo.IsMirror { fail("mirror repository is read-only", "") } @@ -200,7 +200,7 @@ func runServ(c *cli.Context) error { keyID int64 user *models.User ) - if requestedMode == models.ACCESS_MODE_WRITE || repo.IsPrivate { + if requestedMode == models.AccessModeWrite || repo.IsPrivate { keys := strings.Split(c.Args()[0], "-") if len(keys) != 2 { fail("Key ID format error", "Invalid key argument: %s", c.Args()[0]) @@ -243,7 +243,7 @@ func runServ(c *cli.Context) error { fail("Internal error", "Fail to check access: %v", err) } else if mode < requestedMode { clientMessage := accessDenied - if mode >= models.ACCESS_MODE_READ { + if mode >= models.AccessModeRead { clientMessage = "You do not have sufficient authorization for this action" } fail(clientMessage, @@ -276,7 +276,7 @@ func runServ(c *cli.Context) error { fail("Internal error", "Failed to execute git command: %v", err) } - if requestedMode == models.ACCESS_MODE_WRITE { + if requestedMode == models.AccessModeWrite { handleUpdateTask(uuid, user, repoUser, reponame, isWiki) } |