the projects filter now only shows project the user may see

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1727 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
p.tessenow 14 years ago
parent d6ab8fd1b5
commit 5ab34d7d73
  1. 2
      app/models/cost_query/filter/project_id.rb

@ -10,7 +10,7 @@ class CostQuery::Filter::ProjectId < CostQuery::Filter::Base
def self.available_values(user)
map = []
ancestors = []
Project.all.sort_by(&:lft).each do |project|
user.projects.all.sort_by(&:lft).each do |project|
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
ancestors.pop
end

Loading…
Cancel
Save