Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/snippets.rb')
-rw-r--r--lib/api/snippets.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/snippets.rb b/lib/api/snippets.rb
index b5df036c5ca..0aaab9a812f 100644
--- a/lib/api/snippets.rb
+++ b/lib/api/snippets.rb
@@ -74,6 +74,8 @@ module API
desc: 'The visibility of the snippet'
end
post do
+ authorize! :create_snippet
+
attrs = declared_params(include_missing: false).merge(request: request, api: true)
service_response = ::Snippets::CreateService.new(nil, current_user, attrs).execute
snippet = service_response.payload[:snippet]