summaryrefslogtreecommitdiffstats
path: root/modules/middleware/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/middleware/repo.go')
-rw-r--r--modules/middleware/repo.go13
1 files changed, 7 insertions, 6 deletions
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.