summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-06-25 00:44:48 -0400
committerUnknown <joe2010xtmf@163.com>2014-06-25 00:44:48 -0400
commite0f9c628c5ff7399167944b3d0730698487af498 (patch)
treecb296196a29b713d4aa224a296e5088021e6b777 /routers/repo
parentb2801a2e985f11e940a0cd420cea57242ea26d4c (diff)
downloadgitea-e0f9c628c5ff7399167944b3d0730698487af498.tar.gz
gitea-e0f9c628c5ff7399167944b3d0730698487af498.zip
Add create organization
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/http.go8
-rw-r--r--routers/repo/setting.go4
2 files changed, 6 insertions, 6 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index d2bff29973..981266d548 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -107,9 +107,9 @@ func Http(ctx *middleware.Context, params martini.Params) {
}
if !isPublicPull {
- var tp = models.AU_WRITABLE
+ var tp = models.WRITABLE
if isPull {
- tp = models.AU_READABLE
+ tp = models.READABLE
}
has, err := models.HasAccess(authUsername, username+"/"+reponame, tp)
@@ -117,8 +117,8 @@ func Http(ctx *middleware.Context, params martini.Params) {
ctx.Handle(401, "no basic auth and digit auth", nil)
return
} else if !has {
- if tp == models.AU_READABLE {
- has, err = models.HasAccess(authUsername, username+"/"+reponame, models.AU_WRITABLE)
+ if tp == models.READABLE {
+ has, err = models.HasAccess(authUsername, username+"/"+reponame, models.WRITABLE)
if err != nil || !has {
ctx.Handle(401, "no basic auth and digit auth", nil)
return
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 6479cb3041..3d48e79c3d 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -175,7 +175,7 @@ func CollaborationPost(ctx *middleware.Context) {
ctx.Redirect(ctx.Req.RequestURI)
return
}
- has, err := models.HasAccess(name, repoLink, models.AU_WRITABLE)
+ has, err := models.HasAccess(name, repoLink, models.WRITABLE)
if err != nil {
ctx.Handle(500, "setting.CollaborationPost(HasAccess)", err)
return
@@ -196,7 +196,7 @@ func CollaborationPost(ctx *middleware.Context) {
}
if err = models.AddAccess(&models.Access{UserName: name, RepoName: repoLink,
- Mode: models.AU_WRITABLE}); err != nil {
+ Mode: models.WRITABLE}); err != nil {
ctx.Handle(500, "setting.CollaborationPost(AddAccess)", err)
return
}