diff --git a/modules/indexer/issues/db/options.go b/modules/indexer/issues/db/options.go index ebd672a6954a4..de0df2ff8ce71 100644 --- a/modules/indexer/issues/db/options.go +++ b/modules/indexer/issues/db/options.go @@ -74,9 +74,9 @@ func ToDBOptions(ctx context.Context, options *internal.SearchOptions) (*issue_m UpdatedBeforeUnix: convertInt64(options.UpdatedBeforeUnix), PriorityRepoID: 0, IsArchived: 0, - Org: nil, - Team: nil, - User: nil, + Org: options.Org, + Team: options.Team, + User: options.User, } if len(options.MilestoneIDs) == 1 && options.MilestoneIDs[0] == 0 { diff --git a/modules/indexer/issues/dboptions.go b/modules/indexer/issues/dboptions.go index d0ef1c96b4487..38522b0fd9ca3 100644 --- a/modules/indexer/issues/dboptions.go +++ b/modules/indexer/issues/dboptions.go @@ -15,6 +15,9 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp AllPublic: false, IsPull: opts.IsPull, IsClosed: opts.IsClosed, + User: opts.User, + Org: opts.Org, + Team: opts.Team, } if opts.ProjectID != 0 { diff --git a/modules/indexer/issues/internal/model.go b/modules/indexer/issues/internal/model.go index 31acd16bd44e0..7cf952b118a3e 100644 --- a/modules/indexer/issues/internal/model.go +++ b/modules/indexer/issues/internal/model.go @@ -5,6 +5,8 @@ package internal import ( "code.gitea.io/gitea/models/db" + "code.gitea.io/gitea/models/organization" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/util" ) @@ -93,6 +95,10 @@ type SearchOptions struct { db.Paginator SortBy SortBy // sort by field + + Org *organization.Organization // issues permission scope + Team *organization.Team // issues permission scope + User *user_model.User // issues permission scope } type SortBy string