diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-19 16:38:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-19 16:38:27 +0300 |
commit | 18d7766e9e65a0966fd91b0959f49c96f8ad5845 (patch) | |
tree | 93bea1b4d4fb571a34ec92198d6844e481eaa7af /app/models/issue.rb | |
parent | e23e7bc48165be175d7078d5e6fee002057046fd (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-ee
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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 |