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:
authorSophie Herold <sophie@hemio.de>2017-03-30 13:39:02 +0300
committerRémy Coutable <remy@rymai.me>2017-12-11 22:38:53 +0300
commit7ccd6a51a529452cdbd1d39121b067b773fcb170 (patch)
tree3fff27460dd22d90e011d73f0f1efa233cd6273d /app/helpers/labels_helper.rb
parent39d6cc1f59a44b28275986b436ad561bf7bf8ee5 (diff)
Hide issues and MRs in labels list if disabled
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r--app/helpers/labels_helper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb
index e1ba7898ee6..c1c19062c91 100644
--- a/app/helpers/labels_helper.rb
+++ b/app/helpers/labels_helper.rb
@@ -1,6 +1,13 @@
module LabelsHelper
include ActionView::Helpers::TagHelper
+ def show_label_issuables_link?(label, issuables_type, current_user: nil, project: nil)
+ return true if label.is_a?(GroupLabel)
+ return true unless project
+
+ project.feature_available?(issuables_type, current_user)
+ end
+
# Link to a Label
#
# label - Label object to link to