diff options
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r-- | app/models/time_entry.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index 04df5233f..0f8f62889 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -52,4 +52,10 @@ class TimeEntry < ActiveRecord::Base def editable_by?(usr) usr == self.user end + + def self.visible_by(usr) + with_scope(:find => { :conditions => Project.allowed_to_condition(usr, :view_time_entries) }) do + yield + end + end end |