diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/news.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/news.rb b/app/models/news.rb index 4c4943b78..969b37a0d 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2008 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 @@ -29,7 +29,7 @@ class News < ActiveRecord::Base acts_as_activity_provider :find_options => {:include => [:project, :author]} # returns latest news for projects visible by user - def self.latest(user=nil, count=5) - find(:all, :limit => count, :conditions => Project.visible_by(user), :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC") + def self.latest(user = User.current, count = 5) + find(:all, :limit => count, :conditions => Project.allowed_to_condition(user, :view_news), :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC") end end |