Merged r6163, r6171, r6172, r6174 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@6175 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-07-03 15:58:02 +00:00
parent cdc1dfb1e7
commit 971aa889f9
7 changed files with 34 additions and 10 deletions
+5
View File
@@ -165,6 +165,11 @@ class Query < ActiveRecord::Base
["o", "c", "!*", "*", "t", "w"].include? operator_for(field)
end if filters
end
# Returns true if the query is visible to +user+ or the current user.
def visible?(user=User.current)
self.is_public? || self.user_id == user.id
end
def editable_by?(user)
return false unless user