diff options
Diffstat (limited to 'lib/api/project_snippets.rb')
-rw-r--r-- | lib/api/project_snippets.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/project_snippets.rb b/lib/api/project_snippets.rb index 54f2555903f..22ce3c6a066 100644 --- a/lib/api/project_snippets.rb +++ b/lib/api/project_snippets.rb @@ -46,7 +46,7 @@ module API # Example Request: # POST /projects/:id/snippets post ":id/snippets" do - authorize! :write_project_snippet, user_project + authorize! :create_project_snippet, user_project required_attributes! [:title, :file_name, :code, :visibility_level] attrs = attributes_for_keys [:title, :file_name, :visibility_level] @@ -74,7 +74,7 @@ module API # PUT /projects/:id/snippets/:snippet_id put ":id/snippets/:snippet_id" do @snippet = user_project.snippets.find(params[:snippet_id]) - authorize! :modify_project_snippet, @snippet + authorize! :update_project_snippet, @snippet attrs = attributes_for_keys [:title, :file_name, :visibility_level] attrs[:content] = params[:code] if params[:code].present? @@ -98,7 +98,7 @@ module API delete ":id/snippets/:snippet_id" do begin @snippet = user_project.snippets.find(params[:snippet_id]) - authorize! :modify_project_snippet, @snippet + authorize! :update_project_snippet, @snippet @snippet.destroy rescue not_found!('Snippet') |