From cf7707b4fe474e5399481a04911cb08043c14874 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 1 Jun 2015 22:42:53 -0700 Subject: [PATCH] Omit link to generate labels if user does not have access to create them Closes https://github.com/gitlabhq/gitlabhq/issues/8353 --- CHANGELOG | 1 + app/views/projects/labels/index.html.haml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 61e9084a39e..2bf49fd5415 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 7.12.0 (unreleased) + - Omit link to generate labels if user does not have access to create them (Stan Hu) - Disable changing of the source branch in merge request update API (Stan Hu) - Shorten merge request WIP text. - Add option to disallow users from registering any application to use GitLab as an OAuth provider diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 7d19415a7f4..d44fe486212 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -13,4 +13,7 @@ = paginate @labels, theme: 'gitlab' - else .light-well - .nothing-here-block Create first label or #{link_to 'generate', generate_namespace_project_labels_path(@project.namespace, @project), method: :post} default set of labels + - if can? current_user, :admin_label, @project + .nothing-here-block Create first label or #{link_to 'generate', generate_namespace_project_labels_path(@project.namespace, @project), method: :post} default set of labels + - else + .nothing-here-block No labels created