Defect #5360 ยป 0001-Fixed-Issues-report-shows-sub-projects-for-non-memb.patch
app/controllers/reports_controller.rb | ||
---|---|---|
26 | 26 |
@categories = @project.issue_categories |
27 | 27 |
@assignees = @project.members.collect { |m| m.user }.sort |
28 | 28 |
@authors = @project.members.collect { |m| m.user }.sort |
29 |
@subprojects = @project.descendants.active
|
|
29 |
@subprojects = @project.descendants.find(:all, :conditions => Project.visible_by(User.current))
|
|
30 | 30 | |
31 | 31 |
@issues_by_tracker = Issue.by_tracker(@project) |
32 | 32 |
@issues_by_version = Issue.by_version(@project) |
... | ... | |
73 | 73 |
@report_title = l(:field_author) |
74 | 74 |
when "subproject" |
75 | 75 |
@field = "project_id" |
76 |
@rows = @project.descendants.active
|
|
76 |
@rows = @project.descendants.find(:all, :conditions => Project.visible_by(User.current))
|
|
77 | 77 |
@data = Issue.by_subproject(@project) || [] |
78 | 78 |
@report_title = l(:field_subproject) |
79 | 79 |
end |
app/models/issue.rb | ||
---|---|---|
595 | 595 |
#{Issue.table_name} i, #{IssueStatus.table_name} s |
596 | 596 |
where |
597 | 597 |
i.status_id=s.id |
598 |
and i.project_id IN (#{project.descendants.active.collect{|p| p.id}.join(',')})
|
|
599 |
group by s.id, s.is_closed, i.project_id") if project.descendants.active.any?
|
|
598 |
and i.project_id IN (#{project.descendants.find(:all, :conditions => Project.visible_by(User.current)).collect{|p| p.id}.join(',')})
|
|
599 |
group by s.id, s.is_closed, i.project_id") if project.descendants.find(:all, :conditions => Project.visible_by(User.current)).any?
|
|
600 | 600 |
end |
601 | 601 |
# End ReportsController extraction |
602 | 602 |
|