summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-22 13:54:21 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-17 07:39:15 +0100
commit8a02449440b0491a056106d693d502252121740f (patch)
tree4a69c78c987ca82fcdd4fd1806b0034d526c56a2
parent8d1b7f950708a0b759026816fcadb6324b29a208 (diff)
downloadgitlab-ce-8a02449440b0491a056106d693d502252121740f.tar.gz
Do not show issue move form unless user can move
-rw-r--r--app/views/shared/issuable/_form.html.haml2
-rw-r--r--spec/services/issues/move_service_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml
index 22540cbfe69..bb0252ba3de 100644
--- a/app/views/shared/issuable/_form.html.haml
+++ b/app/views/shared/issuable/_form.html.haml
@@ -67,7 +67,7 @@
- if can? current_user, :admin_label, issuable.project
= link_to 'Create new label', new_namespace_project_label_path(issuable.project.namespace, issuable.project), target: :blank
-- if issuable.is_a?(Issue)
+- if issuable.is_a?(Issue) && can?(current_user, :move_issue, issuable.project)
%hr
.form-group
= f.label :move_to_project_id, 'Move', class: 'control-label'
diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb
index d8357f89172..6fda8bc6716 100644
--- a/spec/services/issues/move_service_spec.rb
+++ b/spec/services/issues/move_service_spec.rb
@@ -64,7 +64,7 @@ describe Issues::MoveService, services: true do
end
before do
- note_params = { noteable: old_issue, project: old_project, author: user}
+ note_params = { noteable: old_issue, project: old_project, author: user }
create(:system_note, note_params.merge(note: note_contents.first))
create(:note, note_params.merge(note: note_contents.second))
create(:system_note, note_params.merge(note: note_contents.third))