From 18d7766e9e65a0966fd91b0959f49c96f8ad5845 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 19 Oct 2022 13:38:27 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-4-stable-ee --- app/models/issue.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/models') diff --git a/app/models/issue.rb b/app/models/issue.rb index 153747c75df..754591b8017 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -160,7 +160,7 @@ class Issue < ApplicationRecord scope :with_api_entity_associations, -> { preload(:timelogs, :closed_by, :assignees, :author, :labels, :issuable_severity, milestone: { project: [:route, { namespace: :route }] }, - project: [:route, { namespace: :route }], + project: [:project_feature, :route, { namespace: :route }], duplicated_to: { project: [:project_feature] }) } scope :with_issue_type, ->(types) { where(issue_type: types) } @@ -612,7 +612,9 @@ class Issue < ApplicationRecord # for performance reasons, check commit: 002ad215818450d2cbbc5fa065850a953dc7ada8 # Make sure to sync this method with issue_policy.rb def readable_by?(user) - if user.can_read_all_resources? + if !project.issues_enabled? + false + elsif user.can_read_all_resources? true elsif project.personal? && project.team.owner?(user) true -- cgit v1.2.3