summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-07-31 10:06:53 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-07-31 10:06:53 +0000
commit2ff8b9319face30e184bf1e48a4b0fa141e35fd8 (patch)
tree0965423f2bf9c9859b087ea278099b598b040249
parent02e35a0d2630d6995652d67d32fb2462ae2f68b2 (diff)
parent30aa901d8dda301c7a1af994301fa471a9fca2d3 (diff)
downloadgitlab-ce-2ff8b9319face30e184bf1e48a4b0fa141e35fd8.tar.gz
Merge branch '7038-create-issue-regression' into 'master'
CE-Port of gitlab-ee!6708 Closes gitlab-ee#7038 See merge request gitlab-org/gitlab-ce!20917
-rw-r--r--app/serializers/merge_request_widget_entity.rb4
-rw-r--r--spec/fixtures/api/schemas/entities/merge_request_widget.json1
2 files changed, 5 insertions, 0 deletions
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb
index 4fe04e4b206..63fd9d63ec4 100644
--- a/app/serializers/merge_request_widget_entity.rb
+++ b/app/serializers/merge_request_widget_entity.rb
@@ -132,6 +132,10 @@ class MergeRequestWidgetEntity < IssuableEntity
can?(request.current_user, :create_note, merge_request)
end
+ expose :can_create_issue do |merge_request|
+ can?(current_user, :create_issue, merge_request.project)
+ end
+
expose :can_update do |merge_request|
can?(request.current_user, :update_merge_request, merge_request)
end
diff --git a/spec/fixtures/api/schemas/entities/merge_request_widget.json b/spec/fixtures/api/schemas/entities/merge_request_widget.json
index 3b741d51598..a2ac4d238c7 100644
--- a/spec/fixtures/api/schemas/entities/merge_request_widget.json
+++ b/spec/fixtures/api/schemas/entities/merge_request_widget.json
@@ -81,6 +81,7 @@
"can_revert_on_current_merge_request": { "type": ["boolean", "null"] },
"can_cherry_pick_on_current_merge_request": { "type": ["boolean", "null"] },
"can_create_note": { "type": "boolean" },
+ "can_create_issue": { "type": "boolean" },
"can_update": { "type": "boolean" }
},
"additionalProperties": false