summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/middleware/org.go2
-rw-r--r--modules/middleware/repo.go13
2 files changed, 8 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 8cc6290460..8465af83ef 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -64,9 +64,10 @@ 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 +245,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.