summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-01-08 17:52:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-01-08 17:52:19 +0000
commitcffc5d70264e0fb2813b63798dfbc523d0631ff2 (patch)
treeefa1f7e68c43531c93335c7364196951fc81ffb3 /app
parent7943cb031c4ae9b5a60f0419d7f09d03c884c5e0 (diff)
downloadredmine-cffc5d70264e0fb2813b63798dfbc523d0631ff2.tar.gz
redmine-cffc5d70264e0fb2813b63798dfbc523d0631ff2.zip
Merged r17158 to 3.4-stable (#26705).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17159 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-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?