summaryrefslogtreecommitdiffstats
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-16 17:29:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-16 17:29:30 +0000
commit0786b9ef99b0797f06a72201b1581d7384efc624 (patch)
treefd4abfc5b9476450092ff90a378e3f443b7b1505 /app/controllers/projects_controller.rb
parent7ffdd961e9f92a2f1eb86f1d38ce056e1507e2b3 (diff)
downloadredmine-0786b9ef99b0797f06a72201b1581d7384efc624.tar.gz
redmine-0786b9ef99b0797f06a72201b1581d7384efc624.zip
Replaces TimeEntry.visible_by with a visible scope.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5149 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 459b54784..f80cbbf26 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,5 +1,5 @@
# Redmine - project management software
-# Copyright (C) 2006-2009 Jean-Philippe Lang
+# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -156,11 +156,10 @@ class ProjectsController < ApplicationController
:include => [:project, :status, :tracker],
:conditions => cond)
- TimeEntry.visible_by(User.current) do
- @total_hours = TimeEntry.sum(:hours,
- :include => :project,
- :conditions => cond).to_f
+ if User.current.allowed_to?(:view_time_entries, @project)
+ @total_hours = TimeEntry.visible.sum(:hours, :include => :project, :conditions => cond).to_f
end
+
@key = User.current.rss_key
respond_to do |format|