diff options
author | Lukas Eipert <leipert@gitlab.com> | 2018-07-31 11:02:21 +0200 |
---|---|---|
committer | Lukas Eipert <leipert@gitlab.com> | 2018-07-31 11:02:21 +0200 |
commit | 30aa901d8dda301c7a1af994301fa471a9fca2d3 (patch) | |
tree | 0965423f2bf9c9859b087ea278099b598b040249 | |
parent | 02e35a0d2630d6995652d67d32fb2462ae2f68b2 (diff) | |
download | gitlab-ce-30aa901d8dda301c7a1af994301fa471a9fca2d3.tar.gz |
ensure that merge request widget serializer exposes `can_create_issue`
-rw-r--r-- | app/serializers/merge_request_widget_entity.rb | 4 | ||||
-rw-r--r-- | spec/fixtures/api/schemas/entities/merge_request_widget.json | 1 |
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 |