diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-11 06:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-11 06:09:00 +0300 |
commit | 574ed32358d8e502793bf133099d1b6e3b8e3d76 (patch) | |
tree | fc7e88674da5abf366b3619f5954cacbb1157eef /app/models/issue.rb | |
parent | 67d19cc004e5956ca51a85050fceedaa55750526 (diff) |
Add latest changes from gitlab-org/gitlab@master
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 470b7a3ba96..ea7acf9a5d1 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -166,7 +166,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) } @@ -622,7 +622,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 |