From 074b83f21298c7a4735b8673237222f56c875c11 Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Wed, 21 Apr 2010 00:55:53 -0300 Subject: [PATCH] Fixed: Issues report shows sub-projects for non-members (#5360). --- app/controllers/reports_controller.rb | 4 ++-- app/models/issue.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 4b7942a..33d0e08 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -26,7 +26,7 @@ class ReportsController < ApplicationController @categories = @project.issue_categories @assignees = @project.members.collect { |m| m.user }.sort @authors = @project.members.collect { |m| m.user }.sort - @subprojects = @project.descendants.active + @subprojects = @project.descendants.find(:all, :conditions => Project.visible_by(User.current)) @issues_by_tracker = Issue.by_tracker(@project) @issues_by_version = Issue.by_version(@project) @@ -73,7 +73,7 @@ class ReportsController < ApplicationController @report_title = l(:field_author) when "subproject" @field = "project_id" - @rows = @project.descendants.active + @rows = @project.descendants.find(:all, :conditions => Project.visible_by(User.current)) @data = Issue.by_subproject(@project) || [] @report_title = l(:field_subproject) end diff --git a/app/models/issue.rb b/app/models/issue.rb index 4fa072a..b239b50 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -595,8 +595,8 @@ class Issue < ActiveRecord::Base #{Issue.table_name} i, #{IssueStatus.table_name} s where i.status_id=s.id - and i.project_id IN (#{project.descendants.active.collect{|p| p.id}.join(',')}) - group by s.id, s.is_closed, i.project_id") if project.descendants.active.any? + and i.project_id IN (#{project.descendants.find(:all, :conditions => Project.visible_by(User.current)).collect{|p| p.id}.join(',')}) + group by s.id, s.is_closed, i.project_id") if project.descendants.find(:all, :conditions => Project.visible_by(User.current)).any? end # End ReportsController extraction -- 1.5.5.4