diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-10 03:57:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 20:57:58 +0100 |
commit | 99b2858e628d92bba252be72def409af77af735b (patch) | |
tree | 56159cf10b271307911e6f01626c0c3efba789ab /services/issue | |
parent | b6b1e716654fec3b16d245ef65cf42e57e1bb5b6 (diff) | |
download | gitea-99b2858e628d92bba252be72def409af77af735b.tar.gz gitea-99b2858e628d92bba252be72def409af77af735b.zip |
Move unit into models/unit/ (#17576)
* Move unit into models/unit/
* Rename unit.UnitType as unit.Type
Diffstat (limited to 'services/issue')
-rw-r--r-- | services/issue/assignee.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/services/issue/assignee.go b/services/issue/assignee.go index 12addede75..290a0041ff 100644 --- a/services/issue/assignee.go +++ b/services/issue/assignee.go @@ -6,6 +6,7 @@ package issue import ( "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/unit" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" ) @@ -109,7 +110,7 @@ func IsValidReviewRequest(reviewer, doer *models.User, isAdd bool, issue *models var pemResult bool if isAdd { - pemResult = permReviewer.CanAccessAny(models.AccessModeRead, models.UnitTypePullRequests) + pemResult = permReviewer.CanAccessAny(models.AccessModeRead, unit.TypePullRequests) if !pemResult { return models.ErrNotValidReviewRequest{ Reason: "Reviewer can't read", @@ -122,7 +123,7 @@ func IsValidReviewRequest(reviewer, doer *models.User, isAdd bool, issue *models return nil } - pemResult = permDoer.CanAccessAny(models.AccessModeWrite, models.UnitTypePullRequests) + pemResult = permDoer.CanAccessAny(models.AccessModeWrite, unit.TypePullRequests) if !pemResult { pemResult, err = models.IsOfficialReviewer(issue, doer) if err != nil { @@ -199,7 +200,7 @@ func IsValidTeamReviewRequest(reviewer *models.Team, doer *models.User, isAdd bo } } - doerCanWrite := permission.CanAccessAny(models.AccessModeWrite, models.UnitTypePullRequests) + doerCanWrite := permission.CanAccessAny(models.AccessModeWrite, unit.TypePullRequests) if !doerCanWrite { official, err := models.IsOfficialReviewer(issue, doer) if err != nil { |