Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-19 16:38:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-19 16:38:27 +0300
commit18d7766e9e65a0966fd91b0959f49c96f8ad5845 (patch)
tree93bea1b4d4fb571a34ec92198d6844e481eaa7af /app/models
parente23e7bc48165be175d7078d5e6fee002057046fd (diff)
Add latest changes from gitlab-org/gitlab@15-4-stable-ee
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb6
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