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:
Diffstat (limited to 'app/serializers/issue_sidebar_basic_entity.rb')
-rw-r--r--app/serializers/issue_sidebar_basic_entity.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/serializers/issue_sidebar_basic_entity.rb b/app/serializers/issue_sidebar_basic_entity.rb
index 9c6601afd5e..7222b5df425 100644
--- a/app/serializers/issue_sidebar_basic_entity.rb
+++ b/app/serializers/issue_sidebar_basic_entity.rb
@@ -10,6 +10,11 @@ class IssueSidebarBasicEntity < IssuableSidebarBasicEntity
can?(current_user, :update_escalation_status, issue.project)
end
end
+
+ expose :show_crm_contacts do |issuable|
+ current_user&.can?(:read_crm_contact, issuable.project.root_ancestor) &&
+ CustomerRelations::Contact.exists_for_group?(issuable.project.root_ancestor)
+ end
end
IssueSidebarBasicEntity.prepend_mod_with('IssueSidebarBasicEntity')