diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-19 11:16:23 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-19 11:16:23 +0000 |
commit | 9ac86d4f4e73d1c5ee48a39f9ebd6b3fbc38c558 (patch) | |
tree | 57e8871e962cba102c23c1eccab427d884b20e60 /app/models/board.rb | |
parent | 1bf492c30ee803e1fbe1eb486c3aac7f6d224221 (diff) | |
download | redmine-9ac86d4f4e73d1c5ee48a39f9ebd6b3fbc38c558.tar.gz redmine-9ac86d4f4e73d1c5ee48a39f9ebd6b3fbc38c558.zip |
Wiki links for news and forums (#9600).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7840 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/board.rb')
-rw-r--r-- | app/models/board.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/board.rb b/app/models/board.rb index 0663a13af..a76868d09 100644 --- a/app/models/board.rb +++ b/app/models/board.rb @@ -27,6 +27,9 @@ class Board < ActiveRecord::Base validates_length_of :name, :maximum => 30 validates_length_of :description, :maximum => 255 + named_scope :visible, lambda {|*args| { :include => :project, + :conditions => Project.allowed_to_condition(args.shift || User.current, :view_messages, *args) } } + def visible?(user=User.current) !user.nil? && user.allowed_to?(:view_messages, project) end |