1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor and fix incorrect comment (#1247)

This commit is contained in:
Ethan Koenig
2017-03-14 20:51:46 -04:00
committed by Lunny Xiao
parent 7d8f9d1c46
commit ec0ae5d50c
20 changed files with 74 additions and 84 deletions

View File

@@ -152,13 +152,13 @@ func HTTP(ctx *context.Context) {
}
if !isPublicPull {
has, err := models.HasAccess(authUser, repo, accessMode)
has, err := models.HasAccess(authUser.ID, repo, accessMode)
if err != nil {
ctx.Handle(http.StatusInternalServerError, "HasAccess", err)
return
} else if !has {
if accessMode == models.AccessModeRead {
has, err = models.HasAccess(authUser, repo, models.AccessModeWrite)
has, err = models.HasAccess(authUser.ID, repo, models.AccessModeWrite)
if err != nil {
ctx.Handle(http.StatusInternalServerError, "HasAccess2", err)
return