aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/serve.go
diff options
context:
space:
mode:
authorPeter Smit <peter@smitmail.eu>2015-02-12 14:25:07 +0200
committerPeter Smit <peter@smitmail.eu>2015-02-12 14:25:07 +0200
commit6c1ee384f1a45ed97f39b085209bcb79cafd9145 (patch)
tree0798c98ff2fa93324edae6cfcb539cf51fc4b7fd /cmd/serve.go
parent0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608 (diff)
parent0d158e569b0c19614b5e946849e8b7a8e4a75015 (diff)
downloadgitea-6c1ee384f1a45ed97f39b085209bcb79cafd9145.tar.gz
gitea-6c1ee384f1a45ed97f39b085209bcb79cafd9145.zip
Merge remote-tracking branch 'mine/access_refactor' into access_refactor
Conflicts: cmd/serve.go models/access.go models/migrations/migrations.go models/org.go models/repo.go models/user.go modules/middleware/org.go modules/middleware/repo.go routers/api/v1/repo.go routers/org/teams.go routers/repo/http.go routers/user/home.go
Diffstat (limited to 'cmd/serve.go')
-rw-r--r--cmd/serve.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd/serve.go b/cmd/serve.go
index 62e5d14374..54b3714806 100644
--- a/cmd/serve.go
+++ b/cmd/serve.go
@@ -67,14 +67,14 @@ func parseCmd(cmd string) (string, string) {
var (
COMMANDS_READONLY = map[string]models.AccessMode{
- "git-upload-pack": models.WriteAccess,
- "git upload-pack": models.WriteAccess,
- "git-upload-archive": models.WriteAccess,
+ "git-upload-pack": models.ACCESS_MODE_WRITE,
+ "git upload-pack": models.ACCESS_MODE_WRITE,
+ "git-upload-archive": models.ACCESS_MODE_WRITE,
}
COMMANDS_WRITE = map[string]models.AccessMode{
- "git-receive-pack": models.ReadAccess,
- "git receive-pack": models.ReadAccess,
+ "git-receive-pack": models.ACCESS_MODE_READ,
+ "git receive-pack": models.ACCESS_MODE_READ,
}
)
@@ -155,7 +155,7 @@ func runServ(k *cli.Context) {
switch {
case isWrite:
- has, err := models.HasAccess(user, repo, models.WriteAccess)
+ has, err := models.HasAccess(user, repo, models.ACCESS_MODE_WRITE)
if err != nil {
println("Gogs: internal error:", err.Error())
log.GitLogger.Fatal(2, "Fail to check write access:", err)
@@ -168,7 +168,7 @@ func runServ(k *cli.Context) {
break
}
- has, err := models.HasAccess(user, repo, models.ReadAccess)
+ has, err := models.HasAccess(user, repo, models.ACCESS_MODE_READ)
if err != nil {
println("Gogs: internal error:", err.Error())
log.GitLogger.Fatal(2, "Fail to check read access:", err)