summaryrefslogtreecommitdiffstats
path: root/app/models/custom_value.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/custom_value.rb')
-rw-r--r--app/models/custom_value.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/models/custom_value.rb b/app/models/custom_value.rb
index b649ec81d..33da1bd8e 100644
--- a/app/models/custom_value.rb
+++ b/app/models/custom_value.rb
@@ -38,12 +38,18 @@ class CustomValue < ActiveRecord::Base
custom_field.editable?
end
- def visible?
- custom_field.visible?
+ def visible?(user=User.current)
+ if custom_field.visible?
+ true
+ elsif customized.respond_to?(:project)
+ custom_field.visible_by?(customized.project, user)
+ else
+ false
+ end
end
def attachments_visible?(user)
- visible? && customized && customized.visible?(user)
+ visible?(user) && customized && customized.visible?(user)
end
def required?