summaryrefslogtreecommitdiffstats
path: root/models/review.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-28 19:58:28 +0800
committerGitHub <noreply@github.com>2021-11-28 12:58:28 +0100
commit1fee11d69a437ec7e68b3f6b645827592fe77292 (patch)
tree1fca452f96746d9f7cc8c31723e3c365155cf96d /models/review.go
parent24a8d54bfb908a2371cb808a5243b3290dd0664a (diff)
downloadgitea-1fee11d69a437ec7e68b3f6b645827592fe77292.tar.gz
gitea-1fee11d69a437ec7e68b3f6b645827592fe77292.zip
Move accessmode into models/perm (#17828)
Diffstat (limited to 'models/review.go')
-rw-r--r--models/review.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/models/review.go b/models/review.go
index 1c4943f699..eebf796876 100644
--- a/models/review.go
+++ b/models/review.go
@@ -9,6 +9,7 @@ import (
"strings"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/perm"
"code.gitea.io/gitea/models/unit"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/base"
@@ -277,7 +278,7 @@ func isOfficialReviewerTeam(e db.Engine, issue *Issue, team *Team) (bool, error)
}
if !pr.ProtectedBranch.EnableApprovalsWhitelist {
- return team.Authorize >= AccessModeWrite, nil
+ return team.Authorize >= perm.AccessModeWrite, nil
}
return base.Int64sContains(pr.ProtectedBranch.ApprovalsWhitelistTeamIDs, team.ID), nil
@@ -895,12 +896,12 @@ func CanMarkConversation(issue *Issue, doer *user_model.User) (permResult bool,
return false, err
}
- perm, err := GetUserRepoPermission(issue.Repo, doer)
+ p, err := GetUserRepoPermission(issue.Repo, doer)
if err != nil {
return false, err
}
- permResult = perm.CanAccess(AccessModeWrite, unit.TypePullRequests)
+ permResult = p.CanAccess(perm.AccessModeWrite, unit.TypePullRequests)
if !permResult {
if permResult, err = IsOfficialReviewer(issue, doer); err != nil {
return false, err