mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 18:05:19 +02:00
Refactor and fix incorrect comment (#1247)
This commit is contained in:
parent
7d8f9d1c46
commit
ec0ae5d50c
20 changed files with 74 additions and 84 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue