summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-03-14 20:51:46 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-15 08:51:46 +0800
commitec0ae5d50c59315a3c597b1cf24d4c5508c718e5 (patch)
tree6f4d6f826dd9866f9b39b66522ec629555700de2 /modules
parent7d8f9d1c46e38681f2a4033a7da811ab7562d953 (diff)
downloadgitea-ec0ae5d50c59315a3c597b1cf24d4c5508c718e5.tar.gz
gitea-ec0ae5d50c59315a3c597b1cf24d4c5508c718e5.zip
Refactor and fix incorrect comment (#1247)
Diffstat (limited to 'modules')
-rw-r--r--modules/context/repo.go2
-rw-r--r--modules/lfs/server.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 1ae98545a7..76af49ffd7 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -219,7 +219,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
if ctx.IsSigned && ctx.User.IsAdmin {
ctx.Repo.AccessMode = models.AccessModeOwner
} else {
- mode, err := models.AccessLevel(ctx.User, repo)
+ mode, err := models.AccessLevel(ctx.User.ID, repo)
if err != nil {
ctx.Handle(500, "AccessLevel", err)
return
diff --git a/modules/lfs/server.go b/modules/lfs/server.go
index 1bdeadc463..782d972fa9 100644
--- a/modules/lfs/server.go
+++ b/modules/lfs/server.go
@@ -463,7 +463,7 @@ func authenticate(ctx *context.Context, repository *models.Repository, authoriza
}
if ctx.IsSigned {
- accessCheck, _ := models.HasAccess(ctx.User, repository, accessMode)
+ accessCheck, _ := models.HasAccess(ctx.User.ID, repository, accessMode)
return accessCheck
}
@@ -499,7 +499,7 @@ func authenticate(ctx *context.Context, repository *models.Repository, authoriza
return false
}
- accessCheck, _ := models.HasAccess(userModel, repository, accessMode)
+ accessCheck, _ := models.HasAccess(userModel.ID, repository, accessMode)
return accessCheck
}