summaryrefslogtreecommitdiffstats
path: root/models/issues
diff options
context:
space:
mode:
authorHugo Hoitink <10838836+hoitih@users.noreply.github.com>2022-06-16 01:24:10 +0200
committerGitHub <noreply@github.com>2022-06-16 02:24:10 +0300
commit6473bd333a54f38f333920a6e567edafe6692ff5 (patch)
tree5aeb8544dd3e467e37e9bc71327c063bba42eda8 /models/issues
parent881646520e6eb81303dc6cac9c1003e96a024103 (diff)
downloadgitea-6473bd333a54f38f333920a6e567edafe6692ff5.tar.gz
gitea-6473bd333a54f38f333920a6e567edafe6692ff5.zip
In code search, get code unit accessible repos in one (main) query (#19764)
* When non-admin users use code search, get code unit accessible repos in one main query * Modified some comments to match the changes * Removed unnecessary check for Access Mode in Collaboration table Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/issues')
-rw-r--r--models/issues/issue.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/issues/issue.go b/models/issues/issue.go
index 0f4af3e84f..76a0ea7d0c 100644
--- a/models/issues/issue.go
+++ b/models/issues/issue.go
@@ -1430,7 +1430,7 @@ func issuePullAccessibleRepoCond(repoIDstr string, userID int64, org *organizati
cond = cond.And(
builder.Or(
repo_model.UserOwnedRepoCond(userID), // owned repos
- repo_model.UserCollaborationRepoCond(repoIDstr, userID), // collaboration repos
+ repo_model.UserAccessRepoCond(repoIDstr, userID), // user can access repo in a unit independent way
repo_model.UserAssignedRepoCond(repoIDstr, userID), // user has been assigned accessible public repos
repo_model.UserMentionedRepoCond(repoIDstr, userID), // user has been mentioned accessible public repos
repo_model.UserCreateIssueRepoCond(repoIDstr, userID, isPull), // user has created issue/pr accessible public repos
@@ -1499,7 +1499,7 @@ func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *user_model.User) ([]i
opts.setupSessionNoLimit(sess)
- accessCond := repo_model.AccessibleRepositoryCondition(user)
+ accessCond := repo_model.AccessibleRepositoryCondition(user, unit.TypeInvalid)
if err := sess.Where(accessCond).
Distinct("issue.repo_id").
Table("issue").