summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/view.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/view.go')
-rw-r--r--routers/web/repo/view.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index bc8396ab79..9e0f670cf9 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -20,6 +20,7 @@ import (
"time"
"code.gitea.io/gitea/models"
+ asymkey_model "code.gitea.io/gitea/models/asymkey"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
unit_model "code.gitea.io/gitea/models/unit"
@@ -777,9 +778,11 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri
ctx.Data["LatestCommit"] = latestCommit
if latestCommit != nil {
- verification := models.ParseCommitWithSignature(latestCommit)
+ verification := asymkey_model.ParseCommitWithSignature(latestCommit)
- if err := models.CalculateTrustStatus(verification, ctx.Repo.Repository, nil); err != nil {
+ if err := asymkey_model.CalculateTrustStatus(verification, ctx.Repo.Repository.GetTrustModel(), func(user *user_model.User) (bool, error) {
+ return models.IsUserRepoAdmin(ctx.Repo.Repository, user)
+ }, nil); err != nil {
ctx.ServerError("CalculateTrustStatus", err)
return nil
}