diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-06-08 17:16:24 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-06-08 17:16:24 +0300 |
commit | 1bc80c2587323b9107ec3fb2fe6024d7e7817e35 (patch) | |
tree | 613b86c72c3896e7178ced893ac9c3074156b54a /app | |
parent | ba564a09d73dce3a6696dfeb55e78648ae23e627 (diff) | |
parent | 737d194c0826beb7783c34e982cea673e3f6a61a (diff) |
Merge branch 'allow-reporters-to-promote-group-labels' into 'master'
Allow group reporters to promote labels
See merge request !12006
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/labels_controller.rb | 6 | ||||
-rw-r--r-- | app/views/shared/_label.html.haml | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index ac151839f61..1beac202efe 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -8,7 +8,7 @@ class Projects::LabelsController < Projects::ApplicationController before_action :authorize_admin_labels!, only: [:new, :create, :edit, :update, :generate, :destroy, :remove_priority, :set_priorities] - before_action :authorize_admin_group!, only: [:promote] + before_action :authorize_admin_group_labels!, only: [:promote] respond_to :js, :html @@ -161,7 +161,7 @@ class Projects::LabelsController < Projects::ApplicationController return render_404 unless can?(current_user, :admin_label, @project) end - def authorize_admin_group! - return render_404 unless can?(current_user, :admin_group, @project.group) + def authorize_admin_group_labels! + return render_404 unless can?(current_user, :admin_label, @project.group) end end diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index bd994cdad01..c185e9b73ee 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -64,7 +64,7 @@ %a.js-subscribe-button{ data: { url: toggle_subscription_group_label_path(label.group, label) } } Group level - - if label.is_a?(ProjectLabel) && label.project.group && can?(current_user, :admin_group, label.project.group) + - if label.is_a?(ProjectLabel) && label.project.group && can?(current_user, :admin_label, label.project.group) = link_to promote_namespace_project_label_path(label.project.namespace, label.project, label), title: "Promote to Group Label", class: 'btn btn-transparent btn-action', data: {confirm: "Promoting this label will make this label available to all projects inside this group. Existing project labels with the same name will be merged. Are you sure?", toggle: "tooltip"}, method: :post do %span.sr-only Promote to Group = icon('level-up') |