diff options
author | Peter Smit <peter@smitmail.eu> | 2015-02-09 13:36:33 +0200 |
---|---|---|
committer | Peter Smit <peter@smitmail.eu> | 2015-02-09 13:36:33 +0200 |
commit | 0d158e569b0c19614b5e946849e8b7a8e4a75015 (patch) | |
tree | 7702d6fbf2d26b789520f7ef9db11946797e1942 /modules | |
parent | 4e79adf6b5bf7ec7bc3b2b47469baafd1cb0b774 (diff) | |
download | gitea-0d158e569b0c19614b5e946849e8b7a8e4a75015.tar.gz gitea-0d158e569b0c19614b5e946849e8b7a8e4a75015.zip |
Change constants to UPPERCASE_WITH_UNDERSCORE style
Diffstat (limited to 'modules')
-rw-r--r-- | modules/middleware/org.go | 2 | ||||
-rw-r--r-- | modules/middleware/repo.go | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/modules/middleware/org.go b/modules/middleware/org.go index cbce54860d..0e544fe4a2 100644 --- a/modules/middleware/org.go +++ b/modules/middleware/org.go @@ -87,7 +87,7 @@ func OrgAssignment(redirect bool, args ...bool) macaron.Handler { return } ctx.Data["Team"] = ctx.Org.Team - ctx.Org.IsAdminTeam = ctx.Org.Team.IsOwnerTeam() || ctx.Org.Team.Authorize >= models.AdminAccess + ctx.Org.IsAdminTeam = ctx.Org.Team.IsOwnerTeam() || ctx.Org.Team.Authorize >= models.ACCESS_MODE_ADMIN } ctx.Data["IsAdminTeam"] = ctx.Org.IsAdminTeam if requireAdminTeam && !ctx.Org.IsAdminTeam { diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 66e6f3a570..bc1d1f9692 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -64,9 +64,9 @@ func ApiRepoAssignment() macaron.Handler { ctx.JSON(500, &base.ApiJsonErr{"AccessLevel: " + err.Error(), base.DOC_URL}) return } - ctx.Repo.IsOwner = mode >= models.WriteAccess - ctx.Repo.IsAdmin = mode >= models.ReadAccess - ctx.Repo.IsTrueOwner = mode >= models.OwnerAccess + ctx.Repo.IsOwner = mode >= models.ACCESS_MODE_WRITE + ctx.Repo.IsAdmin = mode >= models.ACCESS_MODE_READ + ctx.Repo.IsTrueOwner = mode >= models.ACCESS_MODE_OWNER } // Check access. @@ -244,9 +244,9 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { ctx.JSON(500, &base.ApiJsonErr{"AccessLevel: " + err.Error(), base.DOC_URL}) return } - ctx.Repo.IsOwner = mode >= models.WriteAccess - ctx.Repo.IsAdmin = mode >= models.ReadAccess - ctx.Repo.IsTrueOwner = mode >= models.OwnerAccess + ctx.Repo.IsOwner = mode >= models.ACCESS_MODE_WRITE + ctx.Repo.IsAdmin = mode >= models.ACCESS_MODE_READ + ctx.Repo.IsTrueOwner = mode >= models.ACCESS_MODE_OWNER } // Check access. |