summaryrefslogtreecommitdiff
path: root/lib/api/v3/snippets.rb
diff options
context:
space:
mode:
authorJacopo <beschi.jacopo@gmail.com>2017-11-14 10:02:39 +0100
committerJacopo <beschi.jacopo@gmail.com>2017-11-16 17:58:29 +0100
commit181cd299f9e06223e8338e93b1c318c671ccb1aa (patch)
tree0d71dcf3f786496eaa46b9d65ce2626f162015da /lib/api/v3/snippets.rb
parentf2997af4d5cdec3266d3178edeedc36d4e590062 (diff)
downloadgitlab-ce-181cd299f9e06223e8338e93b1c318c671ccb1aa.tar.gz
Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
Diffstat (limited to 'lib/api/v3/snippets.rb')
-rw-r--r--lib/api/v3/snippets.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/v3/snippets.rb b/lib/api/v3/snippets.rb
index 0762fc02d70..126ec72248e 100644
--- a/lib/api/v3/snippets.rb
+++ b/lib/api/v3/snippets.rb
@@ -91,6 +91,7 @@ module API
put ':id' do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
return not_found!('Snippet') unless snippet
+
authorize! :update_personal_snippet, snippet
attrs = declared_params(include_missing: false)
@@ -113,6 +114,7 @@ module API
delete ':id' do
snippet = snippets_for_current_user.find_by(id: params.delete(:id))
return not_found!('Snippet') unless snippet
+
authorize! :destroy_personal_snippet, snippet
snippet.destroy
no_content!