Commit 8c0b6582 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Consider other project issues when filtering authorized issues

parent b121ffc5
...@@ -26,9 +26,9 @@ module IssueLinks ...@@ -26,9 +26,9 @@ module IssueLinks
def issues def issues
return @issues if defined?(@issues) return @issues if defined?(@issues)
authorized_issues = IssuesFinder.new(@current_user, project_id: @project.id).execute
referenced_issues = @issue.referenced_issues.select('issues.*', 'issue_links.id AS issue_links_id') referenced_issues = @issue.referenced_issues.select('issues.*', 'issue_links.id AS issue_links_id')
referred_by_issues = @issue.referred_by_issues.select('issues.*', 'issue_links.id AS issue_links_id') referred_by_issues = @issue.referred_by_issues.select('issues.*', 'issue_links.id AS issue_links_id')
authorized_issues = IssuesFinder.new(@current_user).execute
union = Gitlab::SQL::Union.new([referenced_issues, referred_by_issues]) union = Gitlab::SQL::Union.new([referenced_issues, referred_by_issues])
......
...@@ -38,7 +38,7 @@ describe IssueLinks::ListService, service: true do ...@@ -38,7 +38,7 @@ describe IssueLinks::ListService, service: true do
it 'verifies number of queries' do it 'verifies number of queries' do
recorded = ActiveRecord::QueryRecorder.new { subject } recorded = ActiveRecord::QueryRecorder.new { subject }
expect(recorded.count).to be_within(1).of(46) expect(recorded.count).to be_within(1).of(37)
end end
it 'returns related issues JSON' do it 'returns related issues JSON' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment