diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-06-16 21:44:46 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-06-16 21:44:46 +0000 |
commit | b2bf7c6d8c481a3c33a055c39a6810daa6c80a61 (patch) | |
tree | b3dad067cf196c64937f1bf0e146519b17b76025 /app/models/issue_custom_field.rb | |
parent | 1a3ee38c2e3ca077d3efb409567e0466bf1f1f41 (diff) | |
download | redmine-b2bf7c6d8c481a3c33a055c39a6810daa6c80a61.tar.gz redmine-b2bf7c6d8c481a3c33a055c39a6810daa6c80a61.zip |
Respect field visibility when filtering/sorting by associated issue fields (#37255).
Patch by Holger Just.
git-svn-id: https://svn.redmine.org/redmine/trunk@21646 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_custom_field.rb')
-rw-r--r-- | app/models/issue_custom_field.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/issue_custom_field.rb b/app/models/issue_custom_field.rb index 18ec6bb43..de5c9ceb2 100644 --- a/app/models/issue_custom_field.rb +++ b/app/models/issue_custom_field.rb @@ -39,7 +39,7 @@ class IssueCustomField < CustomField project_condition = "EXISTS (SELECT 1 FROM #{CustomField.table_name} ifa WHERE ifa.is_for_all = #{self.class.connection.quoted_true} AND ifa.id = #{id_column})" + " OR #{Issue.table_name}.project_id IN (SELECT project_id FROM #{table_name_prefix}custom_fields_projects#{table_name_suffix} WHERE custom_field_id = #{id_column})" - "((#{sql}) AND (#{tracker_condition}) AND (#{project_condition}))" + "((#{sql}) AND (#{tracker_condition}) AND (#{project_condition}) AND (#{Issue.visible_condition(user)}))" end def validate_custom_field |