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 /routers | |
parent | 0b62aeb495c9c1daf816a754a0e4abbf8c62c2c0 (diff) | |
download | gitea-f388661bda8097b5ff01548e6153c566690c9b5e.tar.gz gitea-f388661bda8097b5ff01548e6153c566690c9b5e.zip |
ACCESS_MODE_* -> AccessMode*
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/api.go | 2 | ||||
-rw-r--r-- | routers/api/v1/repo/repo.go | 4 | ||||
-rw-r--r-- | routers/org/teams.go | 6 | ||||
-rw-r--r-- | routers/repo/http.go | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 2deafa23c1..e8db9cb8e4 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -63,7 +63,7 @@ func repoAssignment() macaron.Handler { } if ctx.IsSigned && ctx.User.IsAdmin { - ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER + ctx.Repo.AccessMode = models.AccessModeOwner } else { mode, err := models.AccessLevel(ctx.User, repo) if err != nil { diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 0b28ee0f92..3aa8995c76 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -99,8 +99,8 @@ func ListMyRepos(ctx *context.APIContext) { for repo, access := range accessibleRepos { repos[i] = repo.APIFormat(&api.Permission{ - Admin: access >= models.ACCESS_MODE_ADMIN, - Push: access >= models.ACCESS_MODE_WRITE, + Admin: access >= models.AccessModeAdmin, + Push: access >= models.AccessModeWrite, Pull: true, }) i++ diff --git a/routers/org/teams.go b/routers/org/teams.go index c6636aa836..c2097935a8 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -226,11 +226,11 @@ func EditTeamPost(ctx *context.Context, form auth.CreateTeamForm) { var auth models.AccessMode switch form.Permission { case "read": - auth = models.ACCESS_MODE_READ + auth = models.AccessModeRead case "write": - auth = models.ACCESS_MODE_WRITE + auth = models.AccessModeWrite case "admin": - auth = models.ACCESS_MODE_ADMIN + auth = models.AccessModeAdmin default: ctx.Error(401) return diff --git a/routers/repo/http.go b/routers/repo/http.go index 529dc3d348..5a3d331fd1 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -133,9 +133,9 @@ func HTTP(ctx *context.Context) { } if !isPublicPull { - var tp = models.ACCESS_MODE_WRITE + var tp = models.AccessModeWrite if isPull { - tp = models.ACCESS_MODE_READ + tp = models.AccessModeRead } has, err := models.HasAccess(authUser, repo, tp) @@ -143,8 +143,8 @@ func HTTP(ctx *context.Context) { ctx.Handle(http.StatusInternalServerError, "HasAccess", err) return } else if !has { - if tp == models.ACCESS_MODE_READ { - has, err = models.HasAccess(authUser, repo, models.ACCESS_MODE_WRITE) + if tp == models.AccessModeRead { + has, err = models.HasAccess(authUser, repo, models.AccessModeWrite) if err != nil { ctx.Handle(http.StatusInternalServerError, "HasAccess2", err) return |